/* ── Reset & base ─────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

:root {
  --black:   #000;
  --white:   #fff;
  --gray-50: #f9f9f9;
  --gray-100:#f0f0f0;
  --gray-300:#ccc;
  --gray-500:#888;
  --gray-700:#444;
  --accent:  #000;
  --danger:  #e53e3e;
  --success: #38a169;
  --radius:  10px;
  --shadow:  0 2px 12px rgba(0,0,0,.08);
  --font: 'Segoe UI', system-ui, sans-serif;
}

body {
  font-family: var(--font);
  background: var(--gray-50);
  color: var(--black);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Navbar ───────────────────────────────────────── */
/* En modo panel manda el header del paso; no se apilan dos barras. */
body[data-flow-mode="panel"] .navbar { display: none; }

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  height: 56px;
  background: var(--black);
  color: var(--white);
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar-brand {
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -.5px;
  color: var(--white);
}

.navbar-actions { display: flex; align-items: center; gap: .75rem; }
.navbar-user { font-size: .875rem; color: var(--gray-300); }

.navbar-menu-btn {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--white);
  flex-shrink: 0;
  margin-right: .25rem;
}
.navbar-menu-btn:hover { background: rgba(255,255,255,.1); }

/* ── FAB de menú (mapa sin appbar) ────────────────── */
/* En el mapa la appbar estorba: se esconde y queda este botón circular. */
body.map-page .navbar { display: none; }

.fab-menu {
  display: none;
  position: fixed;
  top: calc(1rem + env(safe-area-inset-top, 0px));
  left: 1rem;
  z-index: 200;
  width: 44px; height: 44px;
  border: none;
  border-radius: 50%;
  background: var(--black);
  color: var(--white);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0,0,0,.28);
}
body.map-page .fab-menu { display: flex; }
/* Con el panel de pedido/programación abierto manda su propio header. */
body.map-page[data-flow-mode="panel"] .fab-menu,
body.map-overlay-open .fab-menu { display: none; }

/* ── Buttons ──────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .625rem 1.25rem;
  border-radius: var(--radius);
  border: none;
  font-size: .9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .15s, background .15s;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary  { background: var(--black); color: var(--white); }
.btn-primary:hover:not(:disabled) { opacity: .85; }
.btn-ghost    { background: transparent; color: var(--white); border: 1px solid rgba(255,255,255,.3); }
.btn-ghost:hover { background: rgba(255,255,255,.1); }
.btn-full     { width: 100%; }

/* ── Alerts ───────────────────────────────────────── */
.alert {
  padding: .75rem 1rem;
  border-radius: var(--radius);
  font-size: .875rem;
  margin-bottom: 1rem;
}
.alert-error, .form-alert        { background: #fff5f5; color: var(--danger); border: 1px solid #fed7d7; }
.alert-success                   { background: #f0fff4; color: var(--success); border: 1px solid #c6f6d5; }

/* ── Forms ────────────────────────────────────────── */
.form { display: flex; flex-direction: column; gap: 1rem; }

.form-group { display: flex; flex-direction: column; gap: .35rem; }

.form-label {
  font-size: .8125rem;
  font-weight: 600;
  color: var(--gray-700);
  text-transform: uppercase;
  letter-spacing: .04em;
}

.form-input {
  padding: .75rem 1rem;
  border: 1.5px solid var(--gray-300);
  border-radius: var(--radius);
  font-size: 1rem;
  background: var(--white);
  transition: border-color .15s;
  width: 100%;
}
.form-input:focus {
  outline: none;
  border-color: var(--black);
}
.form-error { font-size: .8125rem; color: var(--danger); }

.form-alert {
  padding: .625rem .875rem;
  border-radius: var(--radius);
  font-size: .875rem;
}

/* ── Auth pages ───────────────────────────────────── */
.auth-page {
  background: var(--gray-50);
}
.auth-page .main-content {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  padding: 2rem 1rem;
}

.auth-card {
  background: var(--white);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 420px;
}

.auth-logo {
  font-size: 2rem;
  font-weight: 800;
  text-align: center;
  margin-bottom: 1.5rem;
  letter-spacing: -1px;
}

.auth-title {
  font-size: 1.5rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: .25rem;
}

.auth-subtitle {
  font-size: .9375rem;
  color: var(--gray-500);
  text-align: center;
  margin-bottom: 1.75rem;
}

.auth-footer {
  text-align: center;
  margin-top: 1.5rem;
  font-size: .9rem;
  color: var(--gray-500);
}
.auth-footer a { font-weight: 600; color: var(--black); }

.auth-switch {
  font-size: .9rem;
  color: var(--gray-500);
}
.auth-switch a { font-weight: 600; color: var(--black); }

.auth-role-badge {
  display: block;
  width: fit-content;
  margin: -1rem auto 1.5rem;
  padding: .25rem .75rem;
  border-radius: 999px;
  background: var(--gray-100);
  color: var(--gray-700);
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
}

/* ── Driver auth theme ────────────────────────────
   Same layout as the rider login, different palette so the two
   sign-in screens are never confused with each other. */
.auth-page--driver {
  --black:   #0b3b34;   /* text + primary button */
  --gray-50: #e6f2ee;   /* page background */
  --gray-100:#d3e8e1;
  --accent:  #0f766e;
  background: var(--gray-50);
}
.auth-page--driver .auth-card {
  border-top: 4px solid var(--accent);
  box-shadow: 0 6px 24px rgba(11, 59, 52, .14);
}
.auth-page--driver .auth-logo { color: var(--accent); }
.auth-page--driver .auth-role-badge {
  background: var(--accent);
  color: var(--white);
}
.auth-page--driver .btn-primary { background: var(--accent); }
.auth-page--driver .otp-digit:focus,
.auth-page--driver .form-input:focus { border-color: var(--accent); }

/* ── Home page ────────────────────────────────────── */
.home-page .main-content {
  flex: 1;
  display: flex;
  overflow: hidden;
}

.home-layout {
  display: flex;
  flex: 1;
  height: calc(100dvh - 56px);
}

.ride-panel {
  width: 380px;
  flex-shrink: 0;
  background: var(--white);
  padding: 1.5rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  box-shadow: 2px 0 8px rgba(0,0,0,.06);
}

.panel-title {
  font-size: 1.375rem;
  font-weight: 700;
}

.location-inputs {
  background: var(--gray-50);
  border-radius: var(--radius);
  padding: .75rem;
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

.location-row {
  display: flex;
  align-items: center;
  gap: .75rem;
}

.location-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}
.location-dot.origin { background: var(--black); }
.location-dot.dest   { background: #5b5bfe; }

.location-row .form-input {
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--gray-100);
  border-radius: 0;
  padding: .5rem .25rem;
}
.location-row .form-input:focus { border-bottom-color: var(--black); }

.location-divider {
  height: 1px;
  background: var(--gray-100);
  margin-left: 2rem;
}

/* Categories */
.categories { display: flex; flex-direction: column; gap: 1rem; }
.categories-title { font-weight: 600; font-size: .9375rem; color: var(--gray-700); }

.category-list { display: flex; flex-direction: column; gap: .5rem; }

.category-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .875rem 1rem;
  border: 1.5px solid var(--gray-100);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.category-item:hover     { background: var(--gray-50); }
.category-item.selected  { border-color: var(--black); background: var(--gray-50); }

.category-info   { display: flex; flex-direction: column; gap: .125rem; }
.category-name   { font-weight: 600; font-size: .9375rem; }
.category-eta    { font-size: .8125rem; color: var(--gray-500); }
.category-fare   { font-weight: 700; font-size: 1.0625rem; }

/* Trip status */
.trip-status {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 1rem 0;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--gray-100);
  border-top-color: var(--black);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Map */
.map-placeholder {
  flex: 1;
  background: var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: center;
}
.map-label { color: var(--gray-500); font-size: .9rem; }

/* ── Generic page ─────────────────────────────────── */
.main-content { flex: 1; padding: 1.5rem; }
.page-container { max-width: 640px; margin: 0 auto; }
.page-title { font-size: 1.5rem; font-weight: 700; margin-bottom: 1.5rem; }
.page-subtitle { font-size: 1rem; font-weight: 600; margin: 0 0 .75rem; color: var(--gray-700, #374151); }

/* ── Profile ──────────────────────────────────────── */
.profile-card {
  background: var(--white);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.profile-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--black);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.profile-avatar img   { width: 100%; height: 100%; object-fit: cover; }
.avatar-initials      { color: var(--white); font-size: 1.5rem; font-weight: 700; }

.profile-info   { flex: 1; }
.profile-name   { font-weight: 700; font-size: 1.125rem; }
.profile-meta   { font-size: .875rem; color: var(--gray-500); margin-top: .125rem; }

.profile-stats  { display: flex; gap: 1.5rem; }
.stat           { display: flex; flex-direction: column; align-items: center; gap: .125rem; }
.stat-value     { font-size: 1.25rem; font-weight: 700; }
.stat-label     { font-size: .75rem; color: var(--gray-500); text-transform: uppercase; letter-spacing: .04em; }

/* ── OTP inputs ───────────────────────────────────── */
.otp-inputs {
  display: flex;
  gap: .5rem;
  justify-content: center;
  margin: .25rem 0;
}

.otp-digit {
  width: 48px;
  height: 56px;
  text-align: center;
  font-size: 1.5rem;
  font-weight: 700;
  border: 1.5px solid var(--gray-300);
  border-radius: var(--radius);
  background: var(--white);
  transition: border-color .15s;
  caret-color: transparent;
}
.otp-digit:focus {
  outline: none;
  border-color: var(--black);
  background: var(--gray-50);
}

.btn-back {
  background: none;
  border: none;
  font-size: .875rem;
  color: var(--gray-500);
  cursor: pointer;
  padding: 0;
  margin-bottom: 1rem;
  display: inline-flex;
  align-items: center;
  gap: .25rem;
}
.btn-back:hover { color: var(--black); }

.btn-link {
  background: none;
  border: none;
  font-size: inherit;
  color: var(--black);
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}
.btn-link:disabled { opacity: .4; cursor: default; text-decoration: none; }

.resend-row {
  text-align: center;
  margin-top: 1.25rem;
  font-size: .9rem;
  color: var(--gray-500);
}
.resend-timer { margin-left: .25rem; color: var(--gray-500); }

.form-input--phone { font-size: 1.125rem; letter-spacing: .02em; }

.form-input[readonly] {
  background: var(--gray-100, #f5f5f5);
  color: var(--gray-700, #404040);
  cursor: default;
}
.form-input[readonly]:focus { outline: none; border-color: var(--gray-300, #d4d4d4); }


/* ── Phone field with country picker ───────────────── */
.phone-field {
  position: relative;
  display: flex;
  align-items: stretch;
  gap: .5rem;
}
.phone-field .phone-number { flex: 1; min-width: 0; }

.phone-country {
  display: flex;
  align-items: center;
  gap: .35rem;
  padding: 0 .75rem;
  background: var(--white, #fff);
  border: 1px solid var(--gray-300, #d4d4d4);
  border-radius: 10px;
  font-size: 1rem;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
}
.phone-country:focus-visible { outline: 2px solid var(--black, #111); outline-offset: 1px; }
.phone-flag { font-size: 1.25rem; line-height: 1; }
.phone-caret { font-size: .7rem; color: var(--gray-500, #737373); }
.phone-dial { font-variant-numeric: tabular-nums; }

.phone-dropdown {
  position: absolute;
  z-index: 40;
  top: calc(100% + .35rem);
  left: 0;
  width: min(340px, 100%);
  background: var(--white, #fff);
  border: 1px solid var(--gray-300, #d4d4d4);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0,0,0,.16);
  overflow: hidden;
}
.phone-search {
  width: 100%;
  border: none;
  border-bottom: 1px solid var(--gray-200, #e5e5e5);
  padding: .75rem 1rem;
  font-size: 1rem;
  font-family: inherit;
  outline: none;
}
.phone-list {
  list-style: none;
  margin: 0;
  padding: .25rem 0;
  max-height: 260px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.phone-option {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .55rem 1rem;
  cursor: pointer;
  font-size: .95rem;
}
.phone-option .phone-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.phone-option .phone-dial { color: var(--gray-500, #737373); }
.phone-option.is-active, .phone-option:hover { background: var(--gray-100, #f5f5f5); }
.phone-empty { padding: .9rem 1rem; color: var(--gray-500, #737373); font-size: .9rem; }

/* ── Responsive ───────────────────────────────────── */
@media (max-width: 640px) {
  .auth-card { padding: 2rem 1.25rem; }
}

/* ═══════════════════════════════════════════════════
   MAP PAGE
   ═══════════════════════════════════════════════════ */
.map-page {
  overflow: hidden;
  height: 100dvh;
  background: #e8e8e8;
}
.map-page .main-content {
  padding: 0;
  position: relative;
  height: 100dvh;
}

/* ── Leaflet map ─────────────────────────────────── */
#map {
  position: fixed;
  inset: 0;
  z-index: 0;
}

/* ── Top bar ─────────────────────────────────────── */
.map-topbar {
  position: fixed;
  top: env(safe-area-inset-top, 0);
  left: 0; right: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .75rem 1rem;
  pointer-events: none;
}
.map-topbar > * { pointer-events: auto; }

.topbar-btn {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--white);
  border: none;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,.18);
  flex-shrink: 0;
}
.topbar-btn:hover { background: var(--gray-50); }

.topbar-brand {
  font-weight: 900;
  font-size: 1.1rem;
  letter-spacing: -1px;
  background: var(--white);
  padding: .4rem .9rem;
  border-radius: 22px;
  box-shadow: 0 2px 8px rgba(0,0,0,.18);
  flex: 1;
  text-align: center;
}

.topbar-avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--black);
  color: var(--white);
  font-weight: 700;
  font-size: .95rem;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,.18);
  text-decoration: none;
  flex-shrink: 0;
}

/* ── Locate me button ────────────────────────────── */
.locate-btn {
  position: fixed;
  right: 1rem;
  /* Se apoya sobre lo que haya abajo (tarjeta del home u hoja del flujo).
     --bottom-ui la publica el JS midiendo la UI inferior visible. */
  bottom: calc(var(--bottom-ui, 6rem) + .75rem);
  z-index: 200;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--white);
  border: none;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
}
.locate-btn:hover { background: var(--gray-50); }

/* ── Bottom sheet ────────────────────────────────── */
:root {
  --sheet-radius: 24px;
}

.flow {
  position: fixed;
  z-index: 100;
  background: var(--white);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

/* Modo map: el flujo no ocupa espacio, el mapa es la pantalla. */
.flow[data-mode="map"] {
  inset: auto 0 0 0;
  height: 0;
  padding: 0;
  box-shadow: none;
  visibility: hidden;
}

/* Modo panel: un paso del flujo ocupa la pantalla entera. */
.flow[data-mode="panel"] {
  inset: 0;
  border-radius: 0;
}

/* Modo sheet: el paso vive en una hoja inferior y el mapa sigue a la vista.
   La altura la manda el contenido; el tope evita que tape el mapa entero. */
.flow[data-mode="sheet"] {
  inset: auto 0 0 0;
  max-height: 80dvh;
  border-radius: var(--sheet-radius) var(--sheet-radius) 0 0;
  box-shadow: 0 -8px 40px rgba(0,0,0,.14);
}

/* Modo map-card: mapa arriba, estado del viaje abajo, altura fija. */
.flow[data-mode="map-card"] {
  inset: auto 0 0 0;
  max-height: 45dvh;
  border-radius: var(--sheet-radius) var(--sheet-radius) 0 0;
  box-shadow: 0 -8px 40px rgba(0,0,0,.14);
}

/* El botón de ubicación solo tiene sentido cuando el mapa se ve. */
body[data-flow-mode="panel"] .locate-btn { display: none; }

.flow-header {
  display: none;
  align-items: center;
  gap: .75rem;
  padding: calc(env(safe-area-inset-top, 0px) + .75rem) 1rem .75rem;
  border-bottom: 1px solid var(--gray-100);
  flex-shrink: 0;
}
.flow[data-mode="panel"] .flow-header,
.flow[data-mode="sheet"] .flow-header { display: flex; }

/* En la hoja el header ya no toca el borde superior de la pantalla, así que
   no necesita el inset de la barra de estado. */
.flow[data-mode="sheet"] .flow-header { padding-top: 1rem; }

.flow-back {
  width: 40px; height: 40px;
  border-radius: 50%;
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.flow-back:hover { background: var(--gray-50); }

.flow-title {
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -.3px;
  margin: 0;
}

/* ── FAB de pedido ───────────────────────────────── */
.fab-request {
  position: fixed;
  right: 1rem;
  bottom: calc(1.5rem + env(safe-area-inset-bottom, 0px));
  z-index: 200;
  display: none;
  align-items: center;
  gap: .5rem;
  padding: .95rem 1.4rem;
  border: none;
  border-radius: 999px;
  background: var(--black);
  color: var(--white);
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0,0,0,.28);
}
body[data-flow-mode="map"] .fab-request { display: inline-flex; }

.sheet-section {
  padding: 0 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: .875rem;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  flex: 1;
  min-height: 0;
}

/* ── Idle section ────────────────────────────────── */

.dest-trigger {
  display: flex;
  align-items: center;
  gap: .875rem;
  width: 100%;
  background: var(--gray-50);
  border: 2px solid var(--gray-100);
  border-radius: 16px;
  padding: 1rem 1.125rem;
  cursor: pointer;
  text-align: left;
  font-size: 1rem;
  font-weight: 500;
  color: var(--gray-500);
  transition: border-color .15s, background .15s, box-shadow .15s;
  min-height: 56px;
}
.dest-trigger:hover {
  border-color: var(--gray-300);
  background: var(--white);
  box-shadow: 0 2px 12px rgba(0,0,0,.06);
}
.dest-trigger:active { transform: scale(.99); }

.quick-actions {
  display: flex;
  gap: .5rem;
}
.quick-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .4rem;
  padding: .875rem .5rem;
  background: var(--gray-50);
  border: 1.5px solid var(--gray-100);
  border-radius: 14px;
  cursor: pointer;
  font-size: .8125rem;
  font-weight: 600;
  color: var(--gray-700);
  transition: background .15s, border-color .15s;
  min-height: 72px;
}
.quick-btn:hover { background: var(--white); border-color: var(--gray-300); }
.quick-btn:active { transform: scale(.97); }
.quick-icon {
  width: 22px; height: 22px;
  color: var(--gray-600);
  flex-shrink: 0;
}

.service-type-options {
  display: flex;
  gap: 0.75rem;
}

.service-type-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  padding: 1.25rem 0.5rem;
  border: 1.5px solid var(--gray-300);
  border-radius: 12px;
  background: var(--white);
  font-size: 0.95rem;
}

.service-type-icon {
  font-size: 1.8rem;
}

/* ── Route inputs ────────────────────────────────── */
.route-inputs {
  background: var(--gray-50);
  border-radius: var(--radius);
  padding: .5rem .75rem;
}
.route-row {
  display: flex;
  align-items: center;
  gap: .625rem;
  padding: .375rem 0;
}
.route-dot {
  width: 12px; height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}
.route-dot.origin { background: var(--black); }
.route-dot.dest   { background: #5b5bfe; }
.route-dot.sm     { width: 9px; height: 9px; }

.route-input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: .9375rem;
  outline: none;
  color: var(--black);
}
.route-input::placeholder { color: var(--gray-500); }

.route-sep { padding: 0 .25rem; }
.route-sep-line {
  height: 1px;
  background: var(--gray-300);
  margin-left: 1.5rem;
}

/* ── Suggestions ─────────────────────────────────── */
.suggestions {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}
.suggestion-item {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .875rem 0;
  border: none;
  background: none;
  cursor: pointer;
  text-align: left;
  border-bottom: 1px solid var(--gray-100);
  width: 100%;
}
.suggestion-item:hover { background: var(--gray-50); padding-left: .5rem; }
.suggestion-icon { flex-shrink: 0; color: var(--gray-500); }
.suggestion-text {
  font-size: .9rem;
  color: var(--black);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.suggestions-empty {
  font-size: .875rem;
  color: var(--gray-500);
  padding: 1rem 0;
  text-align: center;
}

/* ── Route summary ───────────────────────────────── */
.schedule-panel {
  background: var(--gray-50);
  border-radius: 14px;
  padding: .875rem 1rem;
  margin-top: .5rem;
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
.schedule-label {
  font-size: .8125rem;
  font-weight: 600;
  color: var(--gray-700, #374151);
}
.schedule-input {
  width: 100%;
  padding: .625rem .75rem;
  border-radius: 10px;
  border: 1px solid var(--gray-200, #e5e7eb);
  font-size: .9375rem;
  font-family: inherit;
}
.schedule-hint {
  font-size: .75rem;
  color: var(--gray-500);
}
.schedule-actions {
  display: flex;
  gap: .5rem;
  margin-top: .25rem;
}
.schedule-actions .btn { flex: 1; }

.route-summary {
  background: var(--gray-50);
  border-radius: 14px;
  padding: .75rem 1rem;
  display: flex;
  flex-direction: column;
  gap: .4rem;
}
.route-summary-row {
  display: flex;
  align-items: center;
  gap: .625rem;
}
.confirm-for {
  font-size: .8125rem;
  color: var(--gray-500);
  margin: .5rem 0 0;
}
.route-stops-hint {
  font-size: .75rem;
  color: var(--gray-500);
  margin-left: 1.25rem;
  margin-top: -.1rem;
}
.route-summary-text {
  flex: 1;
  font-size: .875rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.btn-text-sm {
  background: none; border: none;
  font-size: .8125rem;
  font-weight: 600;
  color: var(--gray-500);
  cursor: pointer;
  flex-shrink: 0;
  text-decoration: underline;
}

/* ── Add stop button (in categories section) ─────────────────────────────── */
.btn-add-stop {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  background: none;
  border: none;
  padding: .5rem 0;
  font-size: .875rem;
  font-weight: 500;
  color: var(--gray-500);
  cursor: pointer;
  width: 100%;
  text-decoration: none;
}
.btn-add-stop:hover { color: var(--black); }
.btn-add-stop:disabled { opacity: .4; cursor: not-allowed; }

/* ── Route timeline (reorderable multi-stop) ─────── */
.route-timeline {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}

.timeline-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--gray-50);
  border-radius: 10px;
  padding: .5rem .625rem;
}

.timeline-label {
  flex: 1;
  text-align: left;
  border: none;
  background: none;
  cursor: pointer;
  padding: 0;
}

/* Agarre del arrastre. `touch-action: none` es lo que hace que el dedo
   arrastre la fila en vez de scrollear la hoja. */
.timeline-drag-handle {
  cursor: grab;
  color: #999;
  flex-shrink: 0;
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}
.timeline-row.dragging {
  opacity: .65;
  background: var(--gray-100, #f2f2f2);
  border-radius: var(--radius, 8px);
  cursor: grabbing;
}
/* Durante el arrastre nada más responde al puntero: sin esto, elementFromPoint
   devuelve el texto de la fila y el navegador intenta seleccionarlo. */
body.reordering { user-select: none; -webkit-user-select: none; }
body.reordering .timeline-label { pointer-events: none; }

.stop-remove {
  background: none;
  border: none;
  color: var(--gray-500);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: .25rem;
  flex-shrink: 0;
}
.stop-remove:hover { color: var(--black); }

/* Instrucción arriba del buscador: el mapa es la otra forma de elegir. */
.pick-hint {
  font-size: .875rem;
  color: var(--gray-500, #666);
  margin: 0 0 .5rem;
}

.favorites-section {
  margin: 0.5rem 0;
}

.suggestions-label {
  font-size: 0.8rem;
  color: #777;
  margin: 0.5rem 0 0.25rem;
}

/* ── Stop pin on map ─────────────────────────────── */
.stop-pin {
  width: 24px; height: 24px;
  background: #f59e0b;
  border: 2px solid #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,.25);
}

/* ── Stop dot in route input rows ────────────────── */
.route-dot.stop-dot, .route-dot.stop-sm {
  background: #f59e0b;
  font-size: 10px; font-weight: 700; color: #fff;
  display: flex; align-items: center; justify-content: center;
}

/* ── Leg breakdown ───────────────────────────────── */
#legBreakdown {
  display: flex;
  flex-direction: column;
  gap: .3rem;
  padding: .6rem .75rem;
  background: var(--gray-50);
  border-radius: 8px;
  font-size: .8rem;
}
.leg-row {
  display: flex;
  align-items: center;
  gap: .5rem;
}
.leg-label { flex: 1; color: var(--gray-600); }
.leg-dist  { color: var(--gray-500); white-space: nowrap; }
.leg-badge {
  background: #dcfce7; color: #15803d;
  font-size: .7rem; font-weight: 600;
  padding: .1rem .35rem;
  border-radius: 4px;
  white-space: nowrap;
}

/* ── Pick-on-map button ──────────────────────────── */
.btn-pick-map {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  background: none;
  border: none;
  padding: .5rem 0;
  font-size: .875rem;
  font-weight: 500;
  color: var(--gray-500);
  cursor: pointer;
  width: 100%;
  margin-top: auto;
}
.btn-pick-map:hover { color: var(--black); }

/* ── Category list ───────────────────────────────── */
.category-list { display: flex; flex-direction: column; gap: .625rem; }

.cat-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.125rem;
  border: 2px solid var(--gray-100);
  border-radius: 18px;
  background: var(--white);
  cursor: pointer;
  transition: border-color .15s, background .15s, box-shadow .15s;
  width: 100%;
  text-align: left;
  min-height: 76px;
}
.cat-item:hover    { background: var(--gray-50); border-color: var(--gray-300); }
.cat-item.selected {
  border-color: var(--black);
  background: var(--gray-50);
  box-shadow: 0 2px 16px rgba(0,0,0,.08);
}
.cat-item:active { transform: scale(.99); }

.cat-icon {
  width: 44px; height: 44px;
  background: var(--gray-100);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  color: var(--gray-700);
  transition: background .15s;
}
.cat-item.selected .cat-icon {
  background: var(--black);
  color: var(--white);
}
.cat-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .2rem; }
.cat-name { font-weight: 700; font-size: 1rem; color: var(--black); }
.cat-meta { font-size: .8125rem; color: var(--gray-500); }
.cat-fare {
  font-weight: 800;
  font-size: 1.125rem;
  flex-shrink: 0;
  color: var(--black);
  letter-spacing: -.01em;
}

/* ── Searching state ─────────────────────────────── */
.searching-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .875rem;
  padding: .75rem 0;
}
.searching-label { font-weight: 700; font-size: 1.0625rem; }
.searching-sub   { font-size: .875rem; color: var(--gray-500); }

.pulse-ring {
  width: 52px; height: 52px;
  border-radius: 50%;
  border: 3px solid var(--black);
  animation: pulseRing 1.2s ease-in-out infinite;
}
@keyframes pulseRing {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%       { transform: scale(1.25); opacity: .4; }
}

/* ── Driver coming state ──────────────────────────── */
.driver-coming-state {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: .5rem 0;
}
.driver-coming-header {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.driver-coming-icon {
  font-size: 2.25rem;
  line-height: 1;
}
.driver-coming-label {
  font-weight: 700;
  font-size: 1rem;
}
.driver-coming-sub {
  font-size: .875rem;
  color: var(--gray-500);
  margin-top: .15rem;
}

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--black);
  color: var(--black);
}
.btn-outline:hover { background: var(--gray-50); }

/* ── Map markers ─────────────────────────────────── */
.map-pin svg {
  filter: drop-shadow(0 3px 5px rgba(0,0,0,.35));
  animation: pin-drop .3s ease-out;
}
@keyframes pin-drop {
  from { transform: translateY(-10px); opacity: 0; }
  to   { transform: translateY(0);     opacity: 1; }
}

.pending-pin {
  position: relative;
  width: 44px; height: 44px;
}
.pending-pin-ring {
  position: absolute;
  top: 50%; left: 50%;
  width: 44px; height: 44px;
  margin: -22px 0 0 -22px;
  background: rgba(91,91,254,.28);
  border-radius: 50%;
  animation: loc-pulse 1.1s ease-out infinite;
}
.pending-pin-core {
  position: absolute;
  top: 50%; left: 50%;
  width: 22px; height: 22px;
  margin: -11px 0 0 -11px;
  border: 2.5px solid rgba(255,255,255,.55);
  border-top-color: #fff;
  border-radius: 50%;
  background: #5b5bfe;
  box-shadow: 0 2px 6px rgba(0,0,0,.35);
  animation: spin .7s linear infinite;
}

.car-marker svg {
  filter: drop-shadow(0 3px 6px rgba(0,0,0,.4));
}

.user-loc {
  position: relative;
  width: 48px; height: 48px;
}
.user-loc-dot {
  position: absolute;
  top: 50%; left: 50%;
  width: 18px; height: 18px;
  margin: -9px 0 0 -9px;
  background: #1a73e8;
  border: 3px solid #fff;
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0,0,0,.35);
}
.user-loc-halo {
  position: absolute;
  top: 50%; left: 50%;
  width: 48px; height: 48px;
  margin: -24px 0 0 -24px;
  background: rgba(26,115,232,.25);
  border-radius: 50%;
  animation: loc-pulse 2.4s ease-out infinite;
}
.user-loc.searching .user-loc-halo {
  animation-duration: 1s;
  background: rgba(26,115,232,.35);
}
@keyframes loc-pulse {
  0%   { transform: scale(.4); opacity: 1; }
  70%  { transform: scale(1);  opacity: 0; }
  100% { transform: scale(1);  opacity: 0; }
}

/* ── Drawer ──────────────────────────────────────── */
.drawer-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 300;
  opacity: 0; pointer-events: none;
  transition: opacity .25s;
}
.drawer-overlay.visible { opacity: 1; pointer-events: auto; }

.drawer {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: min(300px, 80vw);
  background: var(--white);
  z-index: 400;
  transform: translateX(-100%);
  transition: transform .28s cubic-bezier(.32,.72,0,1);
  display: flex; flex-direction: column;
  box-shadow: 4px 0 24px rgba(0,0,0,.15);
}
.drawer.open { transform: translateX(0); }

.drawer-header {
  background: var(--black);
  color: var(--white);
  padding: 2.5rem 1.25rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}
.drawer-avatar {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: rgba(255,255,255,.2);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 1.25rem;
  flex-shrink: 0;
}
.drawer-name  { font-weight: 700; font-size: 1rem; flex: 1; }
.drawer-phone { font-size: .8125rem; color: rgba(255,255,255,.6); margin-top: .1rem; }
.drawer-rating { display: flex; align-items: center; gap: .25rem; font-weight: 700; font-size: .9rem; }

.drawer-menu {
  list-style: none;
  padding: .75rem 0;
  flex: 1;
  overflow-y: auto;
}
.drawer-menu li a {
  display: block;
  padding: .875rem 1.5rem;
  font-size: .9375rem;
  font-weight: 500;
  color: var(--black);
  transition: background .12s;
}
.drawer-menu li a:hover { background: var(--gray-50); text-decoration: none; }
.drawer-divider {
  height: 1px;
  background: var(--gray-100);
  margin: .5rem 0;
}

/* ── Trip history ─────────────────────────────────── */
.trips-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
  color: var(--gray-500);
  text-align: center;
}
.trips-empty-icon { font-size: 3rem; margin-bottom: .5rem; }
.trips-empty-text { font-size: .9375rem; }
.trips-spinner {
  width: 32px; height: 32px;
  border: 3px solid var(--gray-300);
  border-top-color: var(--black);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  margin-bottom: .75rem;
}
@keyframes spin { to { transform: rotate(360deg); } }

.trips-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: .75rem;
  margin-bottom: 1.5rem;
}
.trip-item {
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: var(--radius);
  padding: 1rem;
}
/* Mini-mapa del viaje en el historial. Alto fijo: la lista tiene que seguir
   siendo escaneable, el mapa es una miniatura y no el contenido principal. */
.trip-map {
  height: 140px;
  margin-bottom: .75rem;
  border-radius: calc(var(--radius) - 2px);
  background: var(--gray-100);
  overflow: hidden;
  z-index: 0;  /* mantiene los panes de Leaflet debajo del drawer */
}
.trip-map--empty, .trip-map--no-tiles { background: #e8eaed; }
.trip-map .leaflet-tile-pane canvas { image-rendering: pixelated; }
.trip-map-dot {
  display: block;
  width: 12px; height: 12px;
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,.4);
}

.trip-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: .625rem;
}
.trip-item-date { font-size: .8125rem; color: var(--gray-500); }
.trip-badge {
  font-size: .75rem;
  font-weight: 600;
  padding: .2rem .55rem;
  border-radius: 999px;
  background: var(--gray-100);
  color: var(--gray-700);
}
.trip-badge.status-ok   { background: #dcfce7; color: #166534; }
.trip-badge.status-warn { background: #fef9c3; color: #854d0e; }

.trip-item-route {
  display: flex;
  flex-direction: column;
  gap: .375rem;
  margin-bottom: .625rem;
}
.trip-route-row {
  display: flex;
  align-items: center;
  gap: .5rem;
}
.trip-addr {
  font-size: .875rem;
  color: var(--black);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.trip-item-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: .625rem;
  border-top: 1px solid var(--gray-100);
}
.trip-cat  { font-size: .8125rem; color: var(--gray-500); }
.trip-fare { font-weight: 700; font-size: .9375rem; }

.trips-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: .5rem 0 1.5rem;
}
.trips-page-info { font-size: .875rem; color: var(--gray-500); }

/* ── Driver info card ─────────────────────────────── */
.driver-info-card {
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: .75rem;
}
.driver-info-top {
  display: flex;
  align-items: center;
  gap: .875rem;
}
.driver-info-avatar {
  width: 52px; height: 52px;
  border-radius: 14px;
  background: var(--black);
  color: var(--white);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.driver-info-details { flex: 1; min-width: 0; }
.driver-info-name {
  font-weight: 700;
  font-size: 1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.driver-info-sub {
  font-size: .8125rem;
  color: var(--gray-500);
  margin-top: .125rem;
}
.driver-info-rating {
  display: flex;
  align-items: center;
  gap: .25rem;
  font-size: .8125rem;
  margin-top: .2rem;
}
.driver-info-call {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--gray-100);
  display: flex; align-items: center; justify-content: center;
  color: var(--black);
  flex-shrink: 0;
  transition: background .12s;
}
.driver-info-call:hover { background: var(--gray-300); text-decoration: none; }
.driver-info-vehicle {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-top: .75rem;
  padding-top: .75rem;
  border-top: 1px solid var(--gray-100);
}
.vehicle-plate {
  font-weight: 700;
  font-size: .9375rem;
  background: var(--gray-100);
  border-radius: 4px;
  padding: .2rem .5rem;
  letter-spacing: .05em;
}
.vehicle-desc { font-size: .875rem; color: var(--gray-700); }

.driver-coming-status {
  text-align: center;
  font-size: .9375rem;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: .5rem;
}
.mt-sm { margin-top: .5rem; }


/* ── Rating modal ─────────────────────────────────── */
.rating-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 200;
  padding: 0 0 env(safe-area-inset-bottom, 0);
}
.rating-modal {
  background: var(--white);
  border-radius: var(--radius) var(--radius) 0 0;
  width: 100%;
  max-width: 480px;
  padding: 1.75rem 1.5rem 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}
.rating-modal-title {
  font-size: 1.25rem;
  font-weight: 700;
  text-align: center;
  margin: 0;
}
.rating-modal-driver {
  font-size: .9375rem;
  color: var(--gray-500);
  text-align: center;
  margin: -.5rem 0 0;
}
.stars {
  display: flex;
  gap: .5rem;
}
.star-btn {
  background: none;
  border: none;
  font-size: 2rem;
  cursor: pointer;
  color: var(--gray-300);
  padding: .25rem;
  line-height: 1;
  transition: color .1s, transform .1s;
}
.star-btn:hover,
.star-btn.active { color: #f59e0b; }
.star-btn:active { transform: scale(1.2); }
.rating-comment {
  width: 100%;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: .625rem .75rem;
  font-size: .9375rem;
  font-family: inherit;
  resize: none;
  color: var(--black);
}
.rating-comment:focus {
  outline: none;
  border-color: var(--black);
}
.rating-modal-actions {
  display: flex;
  gap: .75rem;
  width: 100%;
}
.rating-modal-actions .btn { flex: 1; }

.contact-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.contact-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-color, #ddd);
  border-radius: 10px;
  background: #fff;
  font-size: 0.95rem;
}

.contact-row-name {
  font-weight: 600;
}

.contact-row-phone {
  color: #777;
  font-size: 0.85rem;
}

.contact-error {
  color: #c0392b;
  font-size: 0.85rem;
  margin: 0.25rem 0;
}

.nearby-driver-icon {
  pointer-events: none;
}
.nearby-driver-icon svg {
  width: 24px;
  height: 24px;
}

/* ── Overlay de mapa ─────────────────────────────── */
/* Capa aparte del state machine: el paso sigue montado debajo, así al
   cerrar el formulario conserva todo lo cargado. */
.map-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  pointer-events: none;
}
.map-overlay[hidden] { display: none; }

.map-overlay .flow-header,
.map-overlay-footer {
  display: flex;
  pointer-events: auto;
  background: var(--white);
}
.map-overlay .flow-header { position: absolute; top: 0; left: 0; right: 0; }

.map-overlay-footer {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  flex-direction: column;
  gap: .75rem;
  padding: 1rem 1.25rem calc(1rem + env(safe-area-inset-bottom, 0px));
  border-radius: var(--sheet-radius) var(--sheet-radius) 0 0;
  box-shadow: 0 -8px 40px rgba(0,0,0,.14);
}
.map-overlay-address {
  font-size: .9375rem;
  font-weight: 500;
  margin: 0;
  min-height: 1.2em;
}

/* Pin fijo al centro: el mapa se mueve debajo. */
.map-overlay-pin {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -100%);
  pointer-events: none;
}

/* Con el overlay abierto el paso queda oculto pero montado. */
/* Ojo: `body.map-overlay-open .fab-request` empata en especificidad (0,2,0) con
   `body[data-flow-mode="map"] .fab-request`, que muestra el FAB. Desempata el
   orden, así que esta regla tiene que quedar después en el archivo. */
body.map-overlay-open .flow,
body.map-overlay-open .navbar,
body.map-overlay-open .fab-request,
body.map-overlay-open .locate-btn { display: none; }

/* ── Verificación de identidad (KYC) ──────────────── */
.kyc-page { padding-bottom: 3rem; }
.kyc-lead {
  color: var(--gray-600);
  font-size: .9375rem;
  line-height: 1.5;
  margin-bottom: 1.25rem;
}
.kyc-error {
  background: #fdecea;
  border: 1px solid #f5c2c0;
  color: #b3261e;
  border-radius: var(--radius);
  padding: .75rem 1rem;
  margin-bottom: 1rem;
  font-size: .875rem;
}
.kyc-rejected {
  background: #fff4e5;
  border: 1px solid #ffd8a8;
  border-radius: var(--radius);
  padding: .875rem 1rem;
  margin-bottom: 1.25rem;
  font-size: .875rem;
}
.kyc-rejected p { margin-top: .35rem; color: var(--gray-700); }

.kyc-step {
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: var(--radius);
  padding: 1.125rem;
  margin-bottom: 1rem;
}
.kyc-step-title {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: .875rem;
}
.kyc-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: #5b5bfe;
  color: #fff;
  font-size: .75rem;
}
.kyc-field { display: block; margin-bottom: .75rem; }
.kyc-field-label {
  display: block;
  font-size: .8125rem;
  color: var(--gray-600);
  margin-bottom: .25rem;
}
.kyc-save { margin-top: .25rem; }

.kyc-docs { display: grid; gap: .875rem; }
.kyc-doc {
  display: flex;
  gap: .875rem;
  align-items: flex-start;
  border: 1px solid var(--gray-100);
  border-radius: var(--radius);
  padding: .75rem;
}
.kyc-doc--done { border-color: #34a853; background: #f6fbf7; }
.kyc-doc-preview {
  flex: 0 0 84px;
  width: 84px; height: 84px;
  border-radius: 8px;
  background: var(--gray-100);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.kyc-doc-preview img { width: 100%; height: 100%; object-fit: cover; }
.kyc-doc-ph { font-size: 1.5rem; opacity: .5; }
.kyc-doc-body { flex: 1; min-width: 0; }
.kyc-doc-title { font-weight: 600; font-size: .9375rem; }
.kyc-doc-ok { color: #34a853; }
.kyc-doc-hint {
  font-size: .8125rem;
  color: var(--gray-500);
  margin: .2rem 0 .6rem;
  line-height: 1.35;
}
.kyc-doc-btn { display: inline-block; cursor: pointer; }
.kyc-doc-status { font-size: .8125rem; color: var(--gray-500); margin-left: .5rem; }

.kyc-submit { width: 100%; margin-top: .5rem; }
.kyc-foot {
  font-size: .75rem;
  color: var(--gray-500);
  text-align: center;
  margin-top: .875rem;
  line-height: 1.45;
}

.kyc-waiting {
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: var(--radius);
  padding: 2rem 1.25rem;
  text-align: center;
}
.kyc-waiting-icon { font-size: 2.5rem; }
.kyc-waiting-title { font-size: 1.125rem; font-weight: 700; margin: .5rem 0; }
.kyc-waiting-text {
  color: var(--gray-600);
  font-size: .875rem;
  line-height: 1.5;
  margin-bottom: 1.25rem;
}

/* ── Cámara de verificación ──────────────────────── */
.kyc-cam {
  position: fixed;
  inset: 0;
  z-index: 900;
  background: #000;
  display: flex;
  flex-direction: column;
  color: #fff;
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
}
.kyc-cam-head {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .75rem 1rem;
}
.kyc-cam-close {
  background: rgba(255,255,255,.15);
  color: #fff;
  border: 0;
  width: 32px; height: 32px;
  border-radius: 50%;
  font-size: 1rem;
  cursor: pointer;
}
.kyc-cam-title { font-weight: 600; font-size: .9375rem; }

.kyc-cam-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.kyc-cam-stage video,
.kyc-cam-shot {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
/* Guía de encuadre: la cédula entra en un rectángulo tipo tarjeta, la selfie
   en un óvalo. Es solo visual — no recorta la foto que se manda. */
.kyc-cam-frame {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: min(86%, 420px);
  aspect-ratio: 85.6 / 54;   /* proporción real de una cédula */
  border: 2px solid rgba(255,255,255,.9);
  border-radius: 12px;
  box-shadow: 0 0 0 100vmax rgba(0,0,0,.35);
  pointer-events: none;
}
.kyc-cam-frame--face {
  width: min(70%, 300px);
  aspect-ratio: 3 / 4;
  border-radius: 50%;
}
.kyc-cam-hint {
  padding: .75rem 1.25rem;
  font-size: .875rem;
  line-height: 1.4;
  text-align: center;
  color: rgba(255,255,255,.85);
}
.kyc-cam-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .75rem;
  padding: 1rem 1.25rem 1.5rem;
}
.kyc-cam-shutter {
  width: 68px; height: 68px;
  border-radius: 50%;
  background: #fff;
  border: 4px solid rgba(255,255,255,.45);
  background-clip: padding-box;
  cursor: pointer;
}
.kyc-cam-shutter:active { transform: scale(.94); }

/* Permiso de cámara denegado: el bloque de error crece a explicación. */
.kyc-perm-title { font-weight: 700; margin-bottom: .35rem; }
.kyc-perm-text { color: var(--gray-700); line-height: 1.45; }
.kyc-perm-steps {
  margin-top: .6rem;
  padding: .6rem .75rem;
  background: rgba(255,255,255,.6);
  border-radius: 8px;
  line-height: 1.45;
  color: var(--gray-700);
}
.kyc-perm-actions {
  display: flex;
  gap: .5rem;
  margin-top: .75rem;
  flex-wrap: wrap;
}

/* Fee carried over from an earlier cancellation, shown under the fare. */
.cat-fee-note {
  display: block;
  font-size: 11px;
  font-weight: 400;
  color: var(--text-muted, #6b6b6b);
  text-align: right;
  max-width: 120px;
  line-height: 1.2;
}

/* ── Home: "¿A dónde vas?" card ──────────────────── */
.go-card {
  position: fixed;
  left: .75rem; right: .75rem;
  bottom: calc(.75rem + env(safe-area-inset-bottom, 0px));
  z-index: 200;
  display: none;
  flex-direction: column;
  gap: .625rem;
  padding: .75rem;
  background: var(--white);
  border-radius: 20px;
  box-shadow: 0 6px 24px rgba(0,0,0,.18);
}
body[data-flow-mode="map"] .go-card { display: flex; }
.go-search {
  display: flex;
  align-items: center;
  gap: .75rem;
  width: 100%;
  min-height: 56px;
  padding: 0 1rem;
  border: none;
  border-radius: 14px;
  background: var(--gray-100, #f2f2f2);
  color: var(--black);
  font-size: 1.125rem;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}
.go-chips {
  display: flex;
  gap: .5rem;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.go-chips::-webkit-scrollbar { display: none; }
.go-chips:empty { display: none; }
.go-chip {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: .375rem;
  min-height: 40px;
  padding: 0 .875rem;
  border: 1.5px solid var(--gray-200, #e5e5e5);
  border-radius: 999px;
  background: var(--white);
  font-size: .9375rem;
  font-weight: 600;
  white-space: nowrap;
  max-width: 200px;
  cursor: pointer;
}
.go-chip-label { overflow: hidden; text-overflow: ellipsis; }
.go-chip--add { color: var(--gray-700, #555); border-style: dashed; }

/* Route step: secondary options, not gates. */
.route-options { display: flex; gap: .5rem; flex-wrap: wrap; }
.route-opt {
  min-height: 36px;
  padding: 0 .75rem;
  border: 1.5px solid var(--gray-200, #e5e5e5);
  border-radius: 999px;
  background: var(--white);
  font-size: .875rem;
  font-weight: 600;
  cursor: pointer;
}
.route-opt[aria-pressed="true"] { background: var(--black); color: var(--white); border-color: var(--black); }

/* Categories: the price is on the button, choosing is confirming. */
.btn-request { min-height: 56px; font-size: 1.0625rem; font-weight: 700; border-radius: 14px; }

/* Driver on the way / in trip */
.driver-eta { text-align: center; font-size: 1rem; font-weight: 700; margin: -.25rem 0 .25rem; }
.trip-actions { display: grid; grid-template-columns: 1fr auto; gap: .5rem; }
.btn-sos { color: #b3261e; border-color: #b3261e; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
