/* ===== RutaYa · Estilos ===== */
:root {
  --primary: #0b1f3a;
  --accent: #14b8a6;
  --cta: #f97316;
  --cta-ink: #ffffff;
  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-2: #eef2f7;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #dbe3ee;
  --ok: #16a34a;
  --warn: #d97706;
  --danger: #dc2626;
  --shadow: 0 10px 30px rgba(11, 31, 58, .14);
  --radius: 18px;
  --nav-h: 66px;
  --top-h: 58px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #07111f;
  --surface: #0f1d33;
  --surface-2: #16273f;
  --ink: #e6edf7;
  --muted: #93a4bd;
  --line: #233552;
  --shadow: 0 10px 30px rgba(0, 0, 0, .45);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg); color: var(--ink); -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
a { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
.hidden { display: none !important; }
h1, h2, h3 { margin: 0 0 .5rem; line-height: 1.2; }
h1 { font-size: 1.7rem; } h2 { font-size: 1.3rem; } h3 { font-size: 1.05rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }
.row { display: flex; gap: .6rem; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.stack > * + * { margin-top: .75rem; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: .75rem; }
@media (max-width: 700px) { .grid4 { grid-template-columns: 1fr 1fr; } }

/* Splash */
.splash {
  position: fixed; inset: 0; z-index: 9999; display: grid; place-content: center; justify-items: center; gap: 14px;
  background: radial-gradient(circle at 30% 20%, #16406b, var(--primary) 60%); color: #fff; transition: opacity .4s;
}
.splash.fade { opacity: 0; pointer-events: none; }
.splash-logo { width: 96px; height: 96px; animation: pop .7s ease; }
.splash-name { font-size: 1.8rem; font-weight: 800; letter-spacing: .5px; }
.loader { width: 42px; height: 42px; border-radius: 50%; border: 4px solid rgba(255,255,255,.2); border-top-color: var(--accent); animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pop { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes up { from { transform: translateY(16px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(20,184,166,.5); } 50% { box-shadow: 0 0 0 10px rgba(20,184,166,0); } }

/* Barra superior */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000; height: calc(var(--top-h) + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 14px 0; display: flex; align-items: center; justify-content: space-between;
  background: var(--primary); color: #fff; box-shadow: 0 2px 12px rgba(0,0,0,.2);
}
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 800; font-size: 1.15rem; }
.brand img { width: 34px; height: 34px; border-radius: 9px; object-fit: cover; }
.topbar-actions { display: flex; gap: 6px; }
.icon-btn { position: relative; width: 42px; height: 42px; border: 0; border-radius: 12px; background: rgba(255,255,255,.1); color: #fff; display: grid; place-items: center; cursor: pointer; }
.icon-btn svg { width: 22px; height: 22px; fill: currentColor; }
.badge { position: absolute; top: 3px; right: 3px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--cta); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; }

/* Vista */
.view { min-height: 100%; }
body.has-top .view { padding-top: calc(var(--top-h) + env(safe-area-inset-top)); }
body.has-nav .view { padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom)); }
.page { max-width: 980px; margin: 0 auto; padding: 18px 16px 28px; animation: up .35s ease; }
.page.narrow { max-width: 480px; }

/* Navegación inferior */
.bottomnav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 1000; height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom); display: flex; background: var(--surface); border-top: 1px solid var(--line);
}
.bottomnav a { flex: 1; display: grid; place-items: center; align-content: center; gap: 2px; text-decoration: none; color: var(--muted); font-size: .75rem; font-weight: 600; }
.bottomnav a svg { width: 24px; height: 24px; fill: currentColor; }
.bottomnav a.active { color: var(--accent); }

/* Tarjetas y formularios */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.card.flat { box-shadow: none; }
.field { display: grid; gap: 6px; }
.field label { font-size: .85rem; font-weight: 600; color: var(--muted); }
.input, select.input, textarea.input {
  width: 100%; min-height: 50px; padding: 12px 14px; border-radius: 14px; border: 1.5px solid var(--line);
  background: var(--surface); outline: none; transition: border-color .2s, box-shadow .2s;
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(20,184,166,.18); }
textarea.input { min-height: 90px; resize: vertical; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 0 20px;
  border-radius: 14px; border: 0; cursor: pointer; font-weight: 700; font-size: 1rem; text-decoration: none;
  background: var(--surface-2); color: var(--ink); transition: transform .1s, filter .2s, opacity .2s;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.block { width: 100%; }
.btn.cta { background: var(--cta); color: var(--cta-ink); box-shadow: 0 8px 20px rgba(249,115,22,.35); }
.btn.primary { background: var(--primary); color: #fff; }
.btn.accent { background: var(--accent); color: #fff; }
.btn.danger { background: transparent; color: var(--danger); border: 1.5px solid var(--danger); }
.btn.ghost { background: transparent; border: 1.5px solid var(--line); }
.btn.sm { min-height: 40px; padding: 0 14px; font-size: .9rem; border-radius: 12px; }
.btn.waze { background: #33ccff; color: #062a3a; }
.btn svg { width: 20px; height: 20px; fill: currentColor; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { padding: 10px 14px; min-height: 44px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.chip.active { border-color: var(--accent); background: rgba(20,184,166,.12); color: var(--accent); }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: .78rem; font-weight: 700; background: var(--surface-2); }
.pill.ok { background: rgba(22,163,74,.14); color: var(--ok); }
.pill.warn { background: rgba(217,119,6,.15); color: var(--warn); }
.pill.danger { background: rgba(220,38,38,.13); color: var(--danger); }
.pill.info { background: rgba(20,184,166,.15); color: var(--accent); }
.divider { height: 1px; background: var(--line); margin: 12px 0; }
.err { color: var(--danger); font-size: .9rem; min-height: 1.2em; }
.link { background: none; border: 0; color: var(--accent); cursor: pointer; font-weight: 600; padding: 0; }

/* Bienvenida */
.hero {
  min-height: 100vh; min-height: 100dvh; display: grid; align-content: center; gap: 22px; padding: 32px 22px;
  background: radial-gradient(circle at 80% 0%, rgba(20,184,166,.35), transparent 50%), radial-gradient(circle at 0% 100%, rgba(249,115,22,.25), transparent 50%), var(--primary);
  color: #fff; text-align: center;
}
.hero img.logo { width: 110px; height: 110px; margin: 0 auto; border-radius: 26px; animation: pop .7s ease; object-fit: cover; }
.hero h1 { font-size: 2.3rem; }
.hero p { color: #cbd8ea; max-width: 460px; margin: 0 auto; }
.hero .actions { display: grid; gap: 12px; max-width: 380px; width: 100%; margin: 0 auto; }
.hero .btn.ghost { color: #fff; border-color: rgba(255,255,255,.35); }
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-width: 460px; margin: 0 auto; }
.features div { background: rgba(255,255,255,.08); border-radius: 14px; padding: 12px 6px; font-size: .8rem; color: #dbe7f6; }
.features b { display: block; font-size: 1.4rem; margin-bottom: 4px; }

/* Mapa */
.map-screen { position: relative; height: calc(100dvh - var(--top-h) - var(--nav-h) - env(safe-area-inset-top) - env(safe-area-inset-bottom)); }
.map { position: absolute; inset: 0; z-index: 1; background: var(--surface-2); }
.leaflet-container { font: inherit; }
:root[data-theme="dark"] .raster .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(.85) contrast(.9) saturate(.6); }
.leaflet-gl-layer { z-index: 1; }
.eta-box { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; background: rgba(26,115,232,.1); border: 1px solid rgba(26,115,232,.3); margin: 8px 0; }
.eta-box .big { font-size: 1.35rem; font-weight: 800; color: #1a73e8; }
:root[data-theme="dark"] .eta-box .big { color: #8ab4f8; }
.gps-chip { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; font-weight: 700; color: #1a73e8; }
.gps-chip::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: #1a73e8; box-shadow: 0 0 0 3px rgba(26,115,232,.25); }
:root[data-theme="dark"] .leaflet-control-zoom a, :root[data-theme="dark"] .leaflet-control-attribution { background: var(--surface); color: var(--muted); }
.overlay-top { position: absolute; z-index: 500; top: 12px; left: 12px; right: 12px; max-width: 520px; }
.sheet {
  position: absolute; z-index: 500; left: 0; right: 0; bottom: 0; max-height: 70%; overflow: auto;
  background: var(--surface); border-radius: 24px 24px 0 0; box-shadow: 0 -10px 30px rgba(0,0,0,.18); padding: 10px 16px 16px;
  animation: up .35s ease;
}
@media (min-width: 900px) {
  .sheet { left: auto; right: 16px; bottom: 16px; top: 16px; width: 400px; max-height: none; border-radius: 22px; }
  .overlay-top { right: auto; width: 420px; }
}
.sheet { overflow-x: hidden; }
.sheet .grid4 { grid-template-columns: 1fr 1fr; }
.stat { min-width: 0; }
.stat .v { overflow-wrap: anywhere; }
.sheet .handle { width: 44px; height: 5px; background: var(--line); border-radius: 3px; margin: 2px auto 10px; }
.loc-card { padding: 10px; }
.loc-row { display: flex; align-items: center; gap: 10px; position: relative; }
.loc-row + .loc-row { margin-top: 8px; }
.dot { width: 14px; height: 14px; border-radius: 50%; flex: none; }
.dot.a { background: var(--accent); box-shadow: 0 0 0 4px rgba(20,184,166,.25); }
.dot.b { background: var(--cta); border-radius: 3px; box-shadow: 0 0 0 4px rgba(249,115,22,.25); }
.loc-row .input { min-height: 46px; }
.suggest { position: absolute; top: 100%; left: 24px; right: 0; z-index: 10; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); overflow: hidden; margin-top: 4px; }
.suggest button { display: block; width: 100%; text-align: left; padding: 12px; border: 0; background: none; cursor: pointer; border-bottom: 1px solid var(--line); font-size: .9rem; }
.suggest button:hover { background: var(--surface-2); }
.map-hint { position: absolute; z-index: 400; left: 50%; transform: translateX(-50%); bottom: 18px; background: var(--primary); color: #fff; padding: 10px 16px; border-radius: 999px; font-weight: 600; font-size: .9rem; box-shadow: var(--shadow); white-space: nowrap; }
.fab { position: absolute; z-index: 450; right: 14px; width: 50px; height: 50px; border-radius: 50%; border: 0; background: var(--surface); box-shadow: var(--shadow); display: grid; place-items: center; cursor: pointer; color: var(--accent); }
.fab svg { width: 24px; height: 24px; fill: currentColor; }

/* Marcadores */
.mk { width: 22px; height: 22px; border-radius: 50%; border: 4px solid #fff; box-shadow: 0 2px 8px rgba(0,0,0,.4); }
.mk.a { background: var(--accent); }
.mk.b { background: var(--cta); border-radius: 6px; }
.mk.car { width: 38px; height: 38px; border: 3px solid #fff; background: var(--primary); display: grid; place-items: center; font-size: 20px; animation: pulse 2s infinite; }
.mk.me { width: 20px; height: 20px; background: #1a73e8; border: 3px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.15), 0 2px 6px rgba(0,0,0,.35); }
.mk.client { width: 20px; height: 20px; background: #34a853; border: 3px solid #fff; animation: pulse 2s infinite; }
.mk.a { background: #34a853; }
.mk.b { background: #ea4335; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); }

/* Precio */
.price-big { font-size: 2rem; font-weight: 800; }
.breakdown { width: 100%; border-collapse: collapse; font-size: .92rem; }
.breakdown td { padding: 6px 0; border-bottom: 1px dashed var(--line); }
.breakdown td:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.breakdown tr.total td { font-weight: 800; font-size: 1.05rem; border-bottom: 0; padding-top: 10px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 14px; }
.stat .v { font-size: 1.35rem; font-weight: 800; }
.stat .l { font-size: .8rem; color: var(--muted); }

/* Estado del viaje */
.steps { display: flex; gap: 4px; margin: 6px 0 12px; }
.steps span { flex: 1; height: 6px; border-radius: 3px; background: var(--line); transition: background .4s; }
.steps span.on { background: var(--accent); }
.status-title { font-size: 1.25rem; font-weight: 800; }
.driver-card { display: flex; gap: 12px; align-items: center; }
.avatar { width: 52px; height: 52px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), var(--primary)); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 1.2rem; flex: none; }
.stars { display: flex; gap: 6px; justify-content: center; }
.stars button { font-size: 2.2rem; background: none; border: 0; cursor: pointer; color: var(--line); transition: transform .15s, color .15s; padding: 0 2px; }
.stars button.on { color: #f5b301; transform: scale(1.1); }

/* Chofer */
.toggle-big { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); }
.switch { position: relative; width: 64px; height: 36px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: var(--line); border-radius: 36px; cursor: pointer; transition: .3s; }
.switch span::before { content: ""; position: absolute; width: 28px; height: 28px; left: 4px; top: 4px; background: #fff; border-radius: 50%; transition: .3s; box-shadow: 0 2px 6px rgba(0,0,0,.25); }
.switch input:checked + span { background: var(--ok); }
.switch input:checked + span::before { transform: translateX(28px); }
.switch input:disabled + span { opacity: .6; cursor: not-allowed; }
.state-banner { padding: 12px 14px; border-radius: 14px; font-weight: 800; display: flex; align-items: center; gap: 10px; }
.state-banner.on { background: rgba(22,163,74,.13); color: var(--ok); }
.state-banner.off { background: var(--surface-2); color: var(--muted); }
.state-banner.busy { background: rgba(220,38,38,.12); color: var(--danger); }
.req { border-left: 5px solid var(--cta); animation: up .3s ease; }

/* Chat */
.chat { display: flex; flex-direction: column; height: calc(100dvh - var(--top-h) - var(--nav-h) - env(safe-area-inset-top) - env(safe-area-inset-bottom)); max-width: 720px; margin: 0 auto; }
.chat-head { padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--surface); }
.chat-body { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.bubble { max-width: 78%; padding: 10px 14px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); animation: up .2s ease; word-wrap: break-word; }
.bubble.me { align-self: flex-end; background: var(--accent); color: #fff; border-color: transparent; border-bottom-right-radius: 6px; }
.bubble.them { align-self: flex-start; border-bottom-left-radius: 6px; }
.bubble .meta { font-size: .7rem; opacity: .75; margin-top: 4px; text-align: right; }
.chat-foot { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line); background: var(--surface); }
.chat-closed { padding: 12px; text-align: center; background: var(--surface-2); color: var(--muted); font-weight: 600; }

/* Listas / tablas */
.list-item { display: flex; gap: 12px; align-items: center; padding: 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: inherit; }
.list-item + .list-item { margin-top: 10px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
table.t { width: 100%; border-collapse: collapse; font-size: .88rem; }
table.t th, table.t td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
table.t th { background: var(--surface-2); font-size: .78rem; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); }
.tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 12px; scrollbar-width: thin; }
.tabs button { flex: none; padding: 10px 14px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 600; }
.tabs button.active { background: var(--primary); color: #fff; border-color: var(--primary); }
:root[data-theme="dark"] .tabs button.active { background: var(--accent); border-color: var(--accent); }
.admin-map { height: 460px; border-radius: 16px; overflow: hidden; border: 1px solid var(--line); }
.qr-box { display: grid; place-items: center; gap: 10px; }
.qr-box img { width: 260px; height: 260px; background: #fff; padding: 10px; border-radius: 16px; }
.warn-box { background: rgba(217,119,6,.12); border: 1px solid rgba(217,119,6,.4); color: var(--warn); padding: 12px; border-radius: 12px; font-size: .9rem; }

/* Modal, toasts, notificaciones */
.modal { position: fixed; inset: 0; z-index: 2000; background: rgba(2,8,20,.55); display: grid; place-items: center; padding: 16px; animation: fadein .2s; }
@keyframes fadein { from { opacity: 0; } }
.modal-card { width: 100%; max-width: 480px; max-height: 88vh; overflow: auto; background: var(--surface); border-radius: 22px; padding: 20px; box-shadow: var(--shadow); animation: pop .25s ease; }
.toasts { position: fixed; z-index: 3000; top: calc(var(--top-h) + env(safe-area-inset-top) + 10px); left: 50%; transform: translateX(-50%); display: grid; gap: 8px; width: min(92vw, 420px); pointer-events: none; }
.toast { background: var(--primary); color: #fff; padding: 12px 16px; border-radius: 14px; box-shadow: var(--shadow); animation: up .3s ease; font-weight: 600; pointer-events: auto; }
.toast.error { background: var(--danger); }
.toast.ok { background: var(--ok); }
.toast small { display: block; font-weight: 400; opacity: .85; }
.notif-panel { position: fixed; z-index: 1500; top: calc(var(--top-h) + env(safe-area-inset-top) + 6px); right: 10px; width: min(92vw, 360px); max-height: 70vh; overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); padding: 8px; }
.notif-panel .n { padding: 10px; border-radius: 12px; }
.notif-panel .n.unread { background: rgba(20,184,166,.08); }
.notif-panel .n + .n { border-top: 1px solid var(--line); }
.photo-pick.bad { border-style: solid; border-color: var(--danger); }
.photo-pick.bad span { background: var(--danger); color: #fff; padding: 4px 10px; border-radius: 999px; }
.doc-banner { position: fixed; z-index: 1200; left: 10px; right: 10px; top: calc(var(--top-h) + env(safe-area-inset-top) + 8px); background: var(--danger); color: #fff; padding: 10px 14px; border-radius: 12px; font-weight: 700; text-decoration: none; box-shadow: var(--shadow); max-width: 560px; margin: 0 auto; }
.plate { display: inline-block; padding: 3px 10px; border: 2px solid #1f2937; border-radius: 6px; background: #fff; color: #111; font-weight: 800; letter-spacing: 1.5px; font-family: ui-monospace, Consolas, monospace; }
.color-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; border: 1px solid rgba(0,0,0,.3); margin-right: 4px; vertical-align: -1px; }
.next-step { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 14px; background: #1a73e8; color: #fff; margin: 6px 0; }
.next-step .ico { font-size: 1.8rem; }
.next-step .muted { color: rgba(255,255,255,.8); }
.steps-list { margin: 4px 0 8px; font-size: .88rem; }
.steps-list summary { cursor: pointer; font-weight: 700; padding: 6px 0; }
.steps-list .row { padding: 6px 0; border-top: 1px solid var(--line); }
.wa-sim { border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: #efeae2; }
:root[data-theme="dark"] .wa-sim { background: #0b141a; }
.wa-body { height: 420px; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 6px; }
.wa-msg { max-width: 85%; padding: 8px 10px; border-radius: 10px; font-size: .9rem; background: #fff; color: #111; box-shadow: 0 1px 1px rgba(0,0,0,.1); }
.wa-msg.me { align-self: flex-end; background: #d9fdd3; }
:root[data-theme="dark"] .wa-msg { background: #202c33; color: #e9edef; }
:root[data-theme="dark"] .wa-msg.me { background: #005c4b; }
.wa-msg .meta { font-size: .65rem; opacity: .6; text-align: right; margin-top: 2px; }
.wa-btns { display: grid; gap: 4px; margin-top: 6px; }
.wa-btns button { border: 0; border-top: 1px solid rgba(0,0,0,.1); background: none; color: #027eb5; font-weight: 700; padding: 6px; cursor: pointer; text-align: center; }
.wa-btns button small { display: block; font-weight: 400; color: #667; }
.wa-foot { display: flex; gap: 6px; padding: 8px; background: rgba(0,0,0,.04); }
body.nav-open { overflow: hidden; }
.navmode { position: fixed; inset: 0; z-index: 1900; background: #111; display: flex; flex-direction: column; }
.navmode .nav-map { position: absolute; inset: 0; z-index: 1; } /* sus controles quedan debajo de los paneles */
.navmode .leaflet-top.leaflet-right { top: calc(96px + env(safe-area-inset-top)); }
.navmode .leaflet-control-attribution { font-size: 9px; line-height: 1.3; padding: 1px 5px; opacity: .75; max-width: 70vw; border-radius: 6px 0 0 6px; }
.navmode .nav-bottom .btn.accent { color: #fff; }
.nav-top { position: absolute; z-index: 600; top: calc(10px + env(safe-area-inset-top)); left: 10px; right: 10px; display: flex; gap: 12px; align-items: center; background: #1a73e8; color: #fff; padding: 14px 16px; border-radius: 18px; box-shadow: 0 6px 20px rgba(0,0,0,.35); }
.nav-top .ico { font-size: 2.4rem; }
.nav-top .dist { font-size: 1.5rem; font-weight: 800; }
.nav-top .txt { font-size: 1.05rem; }
.nav-bottom { position: absolute; z-index: 600; left: 0; right: 0; bottom: 0; background: #0b1f3a; color: #fff; padding: 14px 16px calc(14px + env(safe-area-inset-bottom)); border-radius: 20px 20px 0 0; box-shadow: 0 -6px 20px rgba(0,0,0,.35); }
.nav-bottom .eta { font-size: 1.6rem; font-weight: 800; color: #4ade80; }
.nav-bottom .btn.ghost { color: #fff; border-color: rgba(255,255,255,.3); }
.nav-recenter { position: absolute; z-index: 600; right: 12px; bottom: calc(var(--nav-panel-visible, 220px) + 12px); border: 0; border-radius: 999px; padding: 10px 14px; font-weight: 700; background: #fff; box-shadow: 0 3px 10px rgba(0,0,0,.3); cursor: pointer; }
.nav-car { width: 44px; height: 44px; border-radius: 50%; background: #1a73e8; color: #fff; border: 3px solid #fff; display: grid; place-items: center; font-size: 22px; box-shadow: 0 2px 10px rgba(0,0,0,.4); transition: transform .3s; }
.nav-arrived { position: absolute; z-index: 700; left: 16px; right: 16px; top: 30%; background: #fff; color: #0f172a; border-radius: 22px; padding: 20px; text-align: center; box-shadow: 0 10px 40px rgba(0,0,0,.5); animation: pop .25s ease; }
@media (min-width: 900px) { .nav-top, .nav-bottom, .nav-arrived { max-width: 520px; left: 20px; right: auto; width: 520px; } .nav-bottom { bottom: 20px; border-radius: 20px; } }
.rep { background: none; border: 0; padding: 0 6px 0 0; font-size: .7rem; color: var(--danger); cursor: pointer; font-weight: 700; opacity: .85; }
.rep.done { color: var(--muted); cursor: default; }
.photo-pick { display: grid; place-items: center; min-height: 110px; border: 2px dashed var(--line); border-radius: 14px; cursor: pointer; background: var(--surface-2) center/cover no-repeat; text-align: center; font-weight: 700; font-size: .9rem; }
.photo-pick.has { border-style: solid; border-color: var(--accent); }
.photo-pick.has span { background: rgba(0,0,0,.55); color: #fff; padding: 4px 10px; border-radius: 999px; }
img.avatar { display: block; }
.success-icon { width: 76px; height: 76px; border-radius: 50%; background: var(--ok); color: #fff; display: grid; place-items: center; font-size: 2.4rem; margin: 0 auto 10px; animation: pop .4s ease; }

/* Promoción del primer viaje */
.promo-box { background: linear-gradient(135deg, #16a34a, #14b8a6); color: #fff; border-radius: 14px; padding: 10px 14px; margin: 4px 0 10px; font-weight: 700; }
.promo-box .small { font-weight: 500; opacity: .95; }
.promo-box s { opacity: .8; }

/* Sugerencias de direcciones */
.suggest button { display: flex !important; gap: 10px; align-items: flex-start; text-align: left; }
.suggest .sg-ico { font-size: 1.1rem; line-height: 1.3; }
.suggest .sg-txt { display: flex; flex-direction: column; min-width: 0; }
.suggest .sg-txt small { color: var(--muted); font-size: .78rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Navegación: herramientas del mapa y panel deslizable */
.navmode .leaflet-control-zoom { display: none; }
.nav-tools { position: absolute; z-index: 650; right: 12px; top: 42%; transform: translateY(-50%); display: flex; flex-direction: column; gap: 8px; }
.nav-tools button { width: 48px; height: 48px; border-radius: 14px; border: 0; background: #fff; color: #0f172a; font-size: 1.35rem; font-weight: 800; box-shadow: 0 3px 12px rgba(0,0,0,.3); cursor: pointer; }
.nav-style-name { position: absolute; z-index: 660; right: 70px; top: 42%; transform: translateY(-50%); background: rgba(15,23,42,.9); color: #fff; padding: 8px 12px; border-radius: 10px; font-weight: 700; font-size: .9rem; }
.nav-bottom { transition: transform .25s ease; touch-action: none; }
.nav-handle { position: relative; display: flex; justify-content: center; align-items: center; height: 26px; margin: -6px 0 4px; cursor: grab; }
.nav-handle .grip { width: 54px; height: 6px; border-radius: 3px; background: rgba(255,255,255,.45); }
.nav-bottom.locked .nav-handle { cursor: default; }
.nav-bottom.locked .nav-handle .grip { opacity: .25; }
.nav-lock { position: absolute; right: 0; top: 0; border: 1px solid rgba(255,255,255,.3); background: transparent; color: #fff; border-radius: 999px; font-size: .75rem; padding: 3px 9px; cursor: pointer; }

/* Navegación 3D (gira con el carro) */
.nav-car3d { width: 46px; height: 46px; filter: drop-shadow(0 3px 6px rgba(0,0,0,.45)); }
.nav-car3d svg { width: 100%; height: 100%; }
.navmode .maplibregl-ctrl-top-right { top: calc(96px + env(safe-area-inset-top)); }
.navmode .maplibregl-ctrl-attrib { font-size: 9px; }
.nav-tools button.on { background: #1a73e8; color: #fff; }
#nav-orient { font-weight: 900; }

/* 🆘 Botón de pánico y alerta roja */
.btn.sos { background: #dc2626; color: #fff; font-weight: 800; border: 0; box-shadow: 0 4px 14px rgba(220,38,38,.45); }
.btn.sos:hover { background: #b91c1c; }
.sos-banner { position: fixed; z-index: 2600; left: 0; right: 0; top: 0; padding: calc(8px + env(safe-area-inset-top)) 12px 8px; background: #dc2626; color: #fff; display: flex; justify-content: space-between; align-items: center; gap: 8px; font-weight: 700; animation: sosblink 1.2s infinite alternate; }
.sos-banner button { background: #fff; color: #b91c1c; border: 0; border-radius: 999px; padding: 8px 14px; font-weight: 800; cursor: pointer; }
@keyframes sosblink { from { background: #b91c1c; } to { background: #ef4444; } }
.sos-overlay { position: fixed; inset: 0; z-index: 3000; background: rgba(185,28,28,.96); display: grid; place-items: center; padding: 16px; animation: sosblink 1s infinite alternate; }
.sos-box { max-width: 460px; width: 100%; color: #fff; text-align: center; }
.sos-box h2 { margin: 6px 0; font-size: 1.6rem; letter-spacing: .5px; }
.sos-box .big { font-size: 1.15rem; }
