:root {
  --verde: #0b6e4f;
  --verde-claro: #e6f3ee;
  --tinta: #1d2329;
  --gris: #5d6873;
  --linea: #e3e7eb;
  --fondo: #ffffff;
  --sombra: 0 6px 24px rgba(16, 24, 32, .16);
  --radio: 16px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--tinta); background: #eef1f4; -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; cursor: pointer; }
#mapa { position: fixed; inset: 0; }

/* ---------- buscador ---------- */
.buscador {
  position: fixed; z-index: 5; top: calc(10px + env(safe-area-inset-top)); left: 10px; right: 10px;
  background: var(--fondo); border-radius: var(--radio); box-shadow: var(--sombra); padding: 8px 52px 8px 10px;
}
.marca { font-size: 13px; color: var(--gris); padding: 2px 4px 6px; display: flex; align-items: center; gap: 6px; }
.marca b { color: var(--verde); font-size: 15px; }
.marca .lugar { margin-left: auto; font-size: 12px; }
.fila { display: flex; align-items: center; gap: 10px; border-radius: 10px; padding: 0 6px; }
.fila + .fila { border-top: 1px solid var(--linea); }
.fila input { flex: 1; min-width: 0; border: 0; outline: 0; font-size: 17px; padding: 12px 0; background: transparent; color: var(--tinta); }
.fila input::placeholder { color: #8a949e; }
.fila input::-webkit-search-cancel-button { display: none; }
.fila:focus-within { background: #f4f7f9; }
.punto { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.punto.o { background: #fff; border: 3px solid #1e88e5; }
.punto.d { background: #e53935; border: 3px solid #e53935; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); }
.x { border: 0; background: #eef1f4; width: 30px; height: 30px; border-radius: 50%; font-size: 13px; color: var(--gris); flex: none; }
.voltear { position: absolute; right: 8px; top: 62px; width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--linea); background: #fff; font-size: 18px; color: var(--gris); }
.sugerencias { list-style: none; margin: 6px -10px -8px -10px; padding: 4px 0; border-top: 1px solid var(--linea); max-height: 52vh; overflow: auto; }
.sugerencias li { display: flex; align-items: center; gap: 12px; padding: 11px 16px; cursor: pointer; }
.sugerencias li[aria-selected="true"], .sugerencias li:hover { background: #f1f5f8; }
.sugerencias .ico { width: 28px; height: 28px; border-radius: 50%; background: #eef1f4; display: grid; place-items: center; flex: none; font-size: 14px; }
.sugerencias .t1 { font-size: 15px; }
.sugerencias .t2 { font-size: 12.5px; color: var(--gris); margin-top: 1px; }
.sugerencias .aviso { color: var(--gris); font-size: 13px; cursor: default; }

/* ---------- botones sobre el mapa ---------- */
.botones-mapa { position: fixed; z-index: 4; right: 10px; display: flex; flex-direction: column; gap: 8px; top: calc(176px + env(safe-area-inset-top)); }
.botones-mapa button { background: #fff; border: 0; box-shadow: var(--sombra); border-radius: 22px; min-width: 44px; height: 44px; padding: 0 14px; font-weight: 600; font-size: 14px; }
#btnYo { font-size: 20px; padding: 0; color: #1e88e5; }

/* ---------- hoja inferior ---------- */
.hoja {
  position: fixed; z-index: 6; left: 0; right: 0; bottom: 0; background: var(--fondo);
  border-radius: 20px 20px 0 0; box-shadow: 0 -6px 24px rgba(16, 24, 32, .14);
  max-height: 52vh; display: flex; flex-direction: column; padding-bottom: env(safe-area-inset-bottom);
  transition: max-height .2s ease;
}
.hoja.chica { max-height: 92px; }
.agarradera { border: 0; background: transparent; padding: 8px 0 4px; flex: none; }
.agarradera span { display: block; width: 42px; height: 5px; border-radius: 3px; background: #cfd6dc; margin: 0 auto; }
#contenido { overflow: auto; padding: 0 16px 16px; }
h2 { font-size: 19px; margin: 4px 0 8px; }
h3 { font-size: 14px; text-transform: uppercase; letter-spacing: .04em; color: var(--gris); margin: 16px 0 8px; }
p { margin: 6px 0; line-height: 1.4; }
.suave { color: var(--gris); font-size: 13.5px; }
.nota { font-size: 12px; color: var(--gris); line-height: 1.4; margin-top: 14px; border-top: 1px solid var(--linea); padding-top: 10px; }
.boton { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 12px; padding: 12px 16px; font-weight: 600; font-size: 15px; background: var(--verde); color: #fff; min-height: 46px; }
.boton.claro { background: var(--verde-claro); color: var(--verde); }
.boton.linea { background: #fff; border: 1px solid var(--linea); color: var(--tinta); }
.botones { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0; }
.botones .boton { flex: 1 1 140px; }
.atras { border: 0; background: none; color: var(--verde); font-weight: 600; padding: 6px 0; font-size: 15px; }

/* chips de ruta */
.ruta { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; height: 26px; padding: 0 8px; border-radius: 7px; color: #fff; font-weight: 700; font-size: 13px; letter-spacing: .02em; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.chips button.ruta { border: 0; }

/* opciones de viaje */
.opcion { display: block; width: 100%; text-align: left; border: 1px solid var(--linea); background: #fff; border-radius: 14px; padding: 12px 14px; margin: 8px 0; }
.opcion:hover { border-color: #b9c4cd; }
.opcion .arriba { display: flex; align-items: baseline; gap: 10px; }
.opcion .min { font-size: 26px; font-weight: 800; }
.opcion .min small { font-size: 14px; font-weight: 600; color: var(--gris); }
.opcion .etiqueta { margin-left: auto; font-size: 12px; font-weight: 700; color: var(--verde); background: var(--verde-claro); padding: 3px 8px; border-radius: 99px; }
.cadena { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin: 8px 0 4px; font-size: 14px; color: var(--gris); }
.cadena .sep { color: #aab3bb; }
.opcion .abajo { font-size: 13px; color: var(--gris); }

/* pasos */
.pasos { list-style: none; margin: 8px 0; padding: 0; }
.pasos li { position: relative; display: flex; gap: 12px; padding: 0 0 16px; }
.pasos li::before { content: ""; position: absolute; left: 15px; top: 32px; bottom: 0; width: 3px; background: var(--c, #cfd6dc); border-radius: 2px; }
.pasos li.pie::before { background: repeating-linear-gradient(#aab3bb 0 4px, transparent 4px 8px); }
.pasos li:last-child::before { display: none; }
.pasos .bola { width: 33px; height: 33px; border-radius: 50%; display: grid; place-items: center; flex: none; background: #eef1f4; font-size: 16px; z-index: 1; }
.pasos .bus .bola { background: var(--c); color: #fff; font-size: 15px; }
.pasos .txt { padding-top: 5px; flex: 1; }
.pasos .txt b { font-size: 15.5px; }
.pasos .txt .suave { display: block; margin-top: 2px; }
.calle { color: var(--tinta); }

/* lista de rutas */
.lista-rutas { list-style: none; margin: 0; padding: 0; }
.lista-rutas li button { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--linea); padding: 11px 2px; }
.lista-rutas .nom { font-size: 15px; }

/* marcadores */
.mk-yo { width: 18px; height: 18px; border-radius: 50%; background: #1e88e5; border: 3px solid #fff; box-shadow: 0 0 0 6px rgba(30, 136, 229, .22); }
.mk-o { width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 4px solid #1e88e5; box-shadow: 0 1px 4px rgba(0,0,0,.3); }
.mk-d { width: 26px; height: 26px; border-radius: 50% 50% 50% 0; background: #e53935; transform: rotate(-45deg); border: 3px solid #fff; box-shadow: 0 1px 5px rgba(0,0,0,.35); }
.mk-p { width: 16px; height: 16px; border-radius: 50%; background: #0b6e4f; border: 3px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.35); }
.maplibregl-ctrl-bottom-right { bottom: var(--hoja, 0px); }

/* ---------- compu ---------- */
@media (min-width: 900px) {
  .buscador { left: 16px; right: auto; width: 400px; top: 16px; }
  .hoja { left: 16px; right: auto; width: 400px; bottom: 16px; top: 214px; max-height: none; border-radius: var(--radio); box-shadow: var(--sombra); }
  .hoja.chica { max-height: none; }
  .agarradera { display: none; }
  #contenido { padding-top: 14px; }
  .botones-mapa { top: 16px; }
  .maplibregl-ctrl-bottom-right { bottom: 0; }
}
