/* Rutas en el mapa (público y Admin) */
.rt-map { height: min(68vh, 560px); min-height: 320px; padding: 0; overflow: hidden; border-radius: 14px; z-index: 0; }
.rt-map-embed { height: 100vh; min-height: 0; border-radius: 0; }
.rt-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; vertical-align: -1px; margin-right: 6px; box-shadow: 0 0 0 2px #fff, 0 0 0 3px rgba(0,0,0,.15); }
.rt-pin-wrap, .re-pin-wrap { background: none; border: 0; }
.rt-pin, .re-pin { display: inline-flex; align-items: center; justify-content: center; min-width: 24px; height: 24px; padding: 0 4px; border-radius: 12px; color: #fff; font: 700 12px/1 system-ui, sans-serif; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.45); }
.re-pin { min-width: 26px; height: 26px; border-radius: 13px; cursor: grab; }
.rt-ll { font: 12px ui-monospace, Menlo, Consolas, monospace; color: #555; }

/* Página pública */
.routes-page .rt-map { margin-bottom: 18px; }
.rt-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 18px; }
.rt-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 16px; }
.rt-card { border-top: 5px solid var(--rt, #d62828); }
.rt-card h2 { margin: 0 0 4px; }
.rt-card-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.rt-stops { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.rt-stops li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 8px 0; border-bottom: 1px solid var(--border, #e5e7eb); }
.rt-stop-go { display: inline-flex; align-items: center; gap: 8px; border: 0; background: none; padding: 0; font: inherit; font-weight: 600; color: inherit; cursor: pointer; text-align: left; }
.rt-num { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; color: #fff; font-size: 12px; font-weight: 700; }

.rt-embed-body { margin: 0; background: #fff; }
.rt-embed-legend { position: absolute; left: 8px; bottom: 22px; z-index: 500; display: flex; flex-direction: column; gap: 4px; max-width: calc(100% - 16px); }
.rt-embed-legend a { background: rgba(255,255,255,.94); padding: 5px 10px; border-radius: 8px; font: 600 13px/1.3 system-ui, sans-serif; color: #111; text-decoration: none; box-shadow: 0 1px 4px rgba(0,0,0,.2); }
.rt-embed-empty { padding: 20px; font-family: system-ui, sans-serif; color: #555; }

/* Admin: lista */
.rt-head { display: flex; gap: 16px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; }
.rt-head p { flex: 1 1 420px; margin: 0; }
.rt-swatch { display: inline-block; width: 14px; height: 14px; border-radius: 4px; vertical-align: -2px; }
.rt-code { user-select: all; }
.rt-inline { display: inline; }
.rs-map { height: 300px; border-radius: 10px; margin: 6px 0 12px; z-index: 0; }

/* Admin: editor */
/* Editor de rutas: ocupa todo el ancho; mapa grande a la izquierda y opciones en pestañas a la derecha */
.admin-main.is-wide { width: calc(100% - 24px); max-width: none; margin: 10px auto 24px; }
.admin-main.is-wide > h1 { font-size: 1.1rem; margin: 0 0 8px; color: var(--muted, #6b7280); font-weight: 600; }
body:has(.admin-main.is-wide) .admin-top { position: static; }
.re-topbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 8px 12px; margin: 0 0 10px; position: sticky; top: 0; z-index: 900; box-shadow: 0 2px 10px rgba(0,0,0,.06); }
.re-top-name { flex: 1 1 320px; min-width: 0; }
.re-form .re-top-name input { font-size: 1.15rem; font-weight: 700; padding: 8px 12px; width: 100%; }
.re-top-pub { margin: 0; white-space: nowrap; }
.re-topbar .re-dist { margin: 0; font-size: .9rem; display: flex; gap: 6px; flex-wrap: wrap; align-items: baseline; }
.re-top-links { font-size: .88rem; white-space: nowrap; }
.re-top-btns { display: flex; gap: 8px; align-items: center; margin-left: auto; }
.re-grid { display: grid; gap: 12px; }
.re-main { min-width: 0; }
.re-panel { padding: 0; min-width: 0; display: flex; flex-direction: column; }
.re-tabs { display: flex; flex-wrap: wrap; gap: 4px; padding: 8px; border-bottom: 1px solid var(--border, #e5e7eb); background: var(--surface-2, #f8fafc); border-radius: 12px 12px 0 0; position: sticky; top: 0; z-index: 2; }
.re-tab-btn { border: 1px solid transparent; background: none; border-radius: 999px; padding: 6px 11px; font: 600 .85rem/1.1 inherit; color: inherit; cursor: pointer; display: inline-flex; align-items: center; gap: 5px; }
.re-tab-btn:hover { background: #fff; border-color: var(--border, #e5e7eb); }
.re-tab-btn[aria-selected=true] { background: var(--primary, #1d4ed8); color: #fff; border-color: var(--primary, #1d4ed8); }
.re-tab-n { font-size: .72rem; min-width: 18px; padding: 1px 5px; border-radius: 9px; background: rgba(0,0,0,.08); text-align: center; }
.re-tab-btn[aria-selected=true] .re-tab-n { background: rgba(255,255,255,.25); }
.re-tab { padding: 14px 16px 18px; }
.re-h { font-size: .95rem; margin: 18px 0 8px; padding-top: 12px; border-top: 1px solid var(--border, #e5e7eb); }
.re-tab > .re-h:first-child, .re-tab > .re-card-head:first-child .re-h { margin-top: 0; padding-top: 0; border-top: 0; }
.re-tab .check { display: block; margin: 6px 0; }
.re-sub { padding-left: 26px; }
.re-card-head .hint { margin: 0; flex: 1; }
@media (min-width: 1100px) {
  .re-grid { grid-template-columns: minmax(0, 1fr) clamp(390px, 33vw, 580px); align-items: start; }
  .re-panel { position: sticky; top: 64px; max-height: calc(100vh - 76px); overflow: auto; }
  .re-map { height: calc(100vh - 205px) !important; max-height: none !important; }
}
@media (max-width: 1099px) { .re-map { height: 62vh !important; } }
.re-qr { display: flex; gap: 14px; align-items: flex-start; margin: 8px 0; }
.re-qr img { width: 150px; height: auto; border: 1px solid var(--border, #e5e7eb); border-radius: 8px; background: #fff; flex: 0 0 auto; }
.re-qr .hint { margin-top: 0; overflow-wrap: anywhere; }
.re-time-rows { display: grid; grid-template-columns: auto auto 1fr; gap: 6px 12px; align-items: center; }
.re-time-rows .check { margin: 0; }
.re-speed { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-weight: 400; }
.re-form .re-speed input { width: 80px; padding: 5px 8px; }
.re-ti-out { color: var(--muted, #6b7280); font-size: .88rem; }
.re-ne-search { display: flex; gap: 6px; }
.re-ne-search input { flex: 1; min-width: 0; }
.re-pois li { flex-wrap: wrap; }
.re-poi-row { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 6px; align-items: center; width: 100%; }
.re-poi-row select, .re-poi-row input { padding: 5px 7px; font-size: .88rem; min-width: 0; }
.re-poi-fields { display: grid; grid-template-columns: minmax(110px, 40%) minmax(0, 1fr); gap: 6px; }
.re-poi-row textarea { grid-column: 2 / 4; font-size: .86rem; padding: 5px 7px; min-height: 0; }
.re-poi-prev, .re-ne-pin { display: flex; justify-content: center; }
.re-co-ll { font: 12px ui-monospace, Menlo, Consolas, monospace; color: var(--muted, #6b7280); }
.re-near-mk { background: none; border: 0; }
.re-near-mk span { display: flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; background: #111827; color: #fff; font: 700 10px/1 system-ui, sans-serif; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.45); }
.re-near-mk.is-placing span { background: #f59e0b; }
.rs-qr { display: grid; gap: 16px; align-items: start; }
@media (min-width: 900px) { .rs-qr { grid-template-columns: minmax(0, 1fr) 280px; } }
.rs-qr-colors { display: flex; flex-wrap: wrap; gap: 10px 16px; margin: 4px 0 10px; }
.rs-qr-colors label { display: flex; flex-direction: column; gap: 4px; font-size: .85rem; margin: 0; }
.rs-qr-colors input[type=color] { width: 54px; height: 36px; padding: 2px; border: 1px solid #d1d5db; border-radius: 8px; background: #fff; }
.rs-qr-prev { margin: 0; text-align: center; }
.rs-qr-prev img { width: 260px; max-width: 100%; height: auto; border: 1px solid var(--border, #e5e7eb); border-radius: 10px; background: #fff; }
.rs-poi-table input { padding: 5px 8px; min-width: 90px; }
.rs-poi-table input[type=color] { min-width: 0; width: 46px; height: 32px; padding: 2px; }
.rs-poi-prev { width: 36px; text-align: center; }
.re-colors { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.re-form .re-colors input[type=color] { flex: 0 0 48px; min-width: 0; -webkit-appearance: none; appearance: none; border: 1px solid #d1d5db; background: #fff; width: 44px; height: 34px; padding: 2px; border-radius: 8px; cursor: pointer; }
.re-swatch { width: 26px; height: 26px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.25); cursor: pointer; padding: 0; }
.re-dist { margin: 10px 0 0; font-size: .92rem; }
.re-stops { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 6px; }
.re-stop { display: grid; grid-template-columns: 28px 1fr 1fr; grid-template-areas: "pin name name" "pin lat lng" "btn btn btn"; gap: 4px 6px; align-items: center; padding: 8px; border: 1px solid var(--border, #e5e7eb); border-radius: 10px; }
.re-stop .re-pin { grid-area: pin; align-self: start; cursor: default; }
.re-stop .re-s-name { grid-area: name; }
.re-stop .re-s-lat { grid-area: lat; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .85rem; }
.re-stop .re-s-lng { grid-area: lng; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .85rem; }
.re-stop input { padding: 6px 8px; min-width: 0; }
.re-s-btns { grid-area: btn; display: flex; gap: 4px; justify-content: flex-end; }
.re-s-btns button { min-width: 30px; height: 28px; border: 1px solid var(--border, #d1d5db); background: var(--surface, #fff); border-radius: 6px; cursor: pointer; font-size: .9rem; }
.re-s-btns button:disabled { opacity: .35; cursor: default; }
.re-s-btns .re-del { color: #b42318; }
.re-row-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.re-bulk { margin-top: 10px; }
.re-bulk textarea { font: .86rem/1.5 ui-monospace, Menlo, Consolas, monospace; margin: 4px 0 8px; }
.re-toolbar { display: flex; flex-wrap: wrap; gap: 8px 18px; padding: 10px 12px; margin-bottom: 10px; }
.re-tb-group { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.re-tb-label { font-weight: 700; font-size: .85rem; }
.re-toolbar select, .re-toolbar input { width: auto; padding: 5px 8px; font-size: .88rem; }
.re-toolbar [aria-pressed=true] { background: var(--primary, #1d4ed8); color: #fff; border-color: var(--primary, #1d4ed8); }
.re-tb-check { margin: 0; font-size: .88rem; }
.re-import { cursor: pointer; }
.re-goto input { width: 210px; }
.re-map-wrap { position: relative; }
.re-map { height: min(72vh, 680px); min-height: 380px; border-radius: 12px; border: 1px solid var(--border, #e5e7eb); z-index: 0; }
.re-map.is-drawing { cursor: crosshair; }
.re-map.is-drawing .leaflet-interactive { cursor: crosshair; }
.re-map.is-busy { opacity: .7; cursor: progress; }
.re-coords { position: absolute; left: 10px; bottom: 26px; z-index: 500; background: rgba(255,255,255,.92); padding: 4px 8px; border-radius: 6px; font: 12px ui-monospace, Menlo, Consolas, monospace; pointer-events: none; }
.re-mode { position: absolute; left: 50%; top: 10px; transform: translateX(-50%); z-index: 600; background: #111; color: #fff; padding: 8px 12px; border-radius: 10px; font-size: .88rem; box-shadow: 0 2px 10px rgba(0,0,0,.3); max-width: calc(100% - 120px); text-align: center; }
.re-mode button { margin-left: 8px; border: 0; border-radius: 6px; padding: 4px 10px; background: #fff; color: #111; font-weight: 700; cursor: pointer; }
.re-pick .leaflet-popup-content { margin: 10px 12px; }
.re-pick-ll { font: 13px ui-monospace, Menlo, Consolas, monospace; margin-bottom: 8px; user-select: all; }
.re-pick-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
.re-pick-btns button { border: 1px solid #d1d5db; background: #fff; border-radius: 6px; padding: 6px 6px; font: 600 12px/1.2 system-ui, sans-serif; cursor: pointer; }
.re-pick-btns button:hover { border-color: #1d4ed8; color: #1d4ed8; }

/* Etiquetas (globos con punta) */
.mrl-wrap { width: 0 !important; height: 0 !important; }
.mrl { position: relative; width: 0; height: 0; }
.mrl-svg { position: absolute; z-index: 0; left: 0; top: 0; overflow: visible; pointer-events: none; }
.mrl.has-shadow .mrl-svg { filter: drop-shadow(0 2px 4px rgba(0,0,0,.35)); }
.mrl-box { position: absolute; z-index: 1; box-sizing: border-box; text-align: center; line-height: 1.22; white-space: pre-wrap; overflow-wrap: anywhere; pointer-events: none; user-select: none; }
.mrl.is-edit .mrl-box { pointer-events: auto; cursor: move; touch-action: none; }
.mrl-imgs { display: flex; justify-content: center; align-items: center; gap: 6px; }
.mrl-imgs + .mrl-text { margin-top: 5px; }
.mrl-imgs img { display: block; width: auto; max-width: 100%; object-fit: contain; }
.mrl-tip { position: absolute; z-index: 2; left: -7px; top: -7px; width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 2px solid #111; box-shadow: 0 1px 3px rgba(0,0,0,.4); cursor: grab; }
.mrl-hidden { display: none; }

/* Íconos y paradas sin número */
.mri-wrap { background: none; border: 0; }
.mri-wrap svg { display: block; overflow: visible; filter: drop-shadow(0 1px 2px rgba(0,0,0,.35)); }
.mri-wrap.is-bare svg { filter: drop-shadow(0 1px 1px rgba(0,0,0,.25)); }
.mr-dot-wrap { background: none; border: 0; }
.mr-dot { display: block; width: 14px; height: 14px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,.45); box-sizing: border-box; }
.re-pin-wrap.is-hidden-stop { opacity: .4; }

/* Editor: opciones, listas y diálogos */
.re-arr { padding: 8px 0 0 26px; }
.re-arr.is-off { opacity: .45; }
.re-arr-col { display: flex; align-items: center; gap: 8px; }
.re-arr-col .check { margin: 0; font-size: .85rem; }
.re-form input[type=color], .re-dlg input[type=color] { width: 48px; height: 34px; padding: 2px; border-radius: 8px; border: 1px solid #d1d5db; background: #fff; cursor: pointer; min-width: 0; }
.re-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.re-card-head h2 { margin: 0; }
.re-items { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.re-items li { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border: 1px solid var(--border, #e5e7eb); border-radius: 10px; }
.re-li-txt { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .9rem; }
.re-items .re-s-btns { grid-area: auto; }
.re-chip { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 24px; border-radius: 7px; font: 700 12px/1 system-ui, sans-serif; border: 2px solid transparent; }
.re-ic-prev { flex: 0 0 26px; display: flex; justify-content: center; }
.re-dlg { width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 32px); padding: 0; border: 0; border-radius: 14px; box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.re-dlg-wide { width: min(900px, calc(100vw - 24px)); }
.re-dlg::backdrop { background: rgba(0,0,0,.25); }
.re-dlg-head, .re-dlg-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 18px; }
.re-dlg-head { border-bottom: 1px solid #e5e7eb; position: sticky; top: 0; background: #fff; z-index: 2; }
.re-dlg-head h2 { margin: 0; }
.re-dlg-foot { border-top: 1px solid #e5e7eb; position: sticky; bottom: 0; background: #fff; }
.re-dlg-x { border: 0; background: none; font-size: 1.2rem; cursor: pointer; padding: 4px 8px; }
.re-dlg-body { padding: 14px 18px; }
.re-dlg .field { margin-bottom: 10px; }
.re-dlg .check { margin: 26px 0 0; }
.re-presets { display: flex; flex-wrap: wrap; gap: 6px; }
.re-presets button { width: 40px; height: 30px; border-radius: 9px; font: 700 13px/1 system-ui, sans-serif; cursor: pointer; background-image: none; }
.re-l-imgs { display: flex; gap: 10px; flex-wrap: wrap; }
.re-l-img { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 110px; padding: 8px; border: 1px dashed #cbd5e1; border-radius: 10px; background: repeating-conic-gradient(#f1f5f9 0 25%, #fff 0 50%) 0 0 / 14px 14px; }
.re-l-img img { max-width: 120px; max-height: 70px; object-fit: contain; }
.re-l-img .is-busy { opacity: .6; }
.re-ic-layout { display: grid; gap: 16px; }
@media (min-width: 760px) { .re-ic-layout { grid-template-columns: minmax(0, 1fr) 260px; } }
.re-ic-searchrow { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.re-ic-search { flex: 1; }
.re-ic-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(42px, 1fr)); gap: 4px; max-height: 340px; overflow: auto; padding: 4px; border: 1px solid #e5e7eb; border-radius: 10px; }
.re-ic-grid button { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; border: 1px solid transparent; border-radius: 8px; background: #fff; cursor: pointer; padding: 0; }
.re-ic-grid button:hover { background: #f1f5f9; border-color: #cbd5e1; }
.re-ic-grid button.is-on { background: #dbeafe; border-color: #1d4ed8; }
.re-ic-img { margin-top: 10px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.re-ic-img img { width: 40px; height: 40px; object-fit: contain; background: repeating-conic-gradient(#f1f5f9 0 25%, #fff 0 50%) 0 0 / 10px 10px; border-radius: 6px; }
.re-ic-preview { display: flex; align-items: center; justify-content: center; min-height: 110px; margin-bottom: 8px; border-radius: 10px; background: #e5e7eb; }
.rt-num.is-dot { width: 12px; height: 12px; margin: 0 6px; }
/* Leaflet pone z-index 200 a todo svg del mapa: el globo debe quedar debajo del texto */
.leaflet-map-pane .mrl .mrl-svg, .mri-wrap svg { z-index: 0; }
/* Selectores de color: que se vea el color elegido (el admin estiliza todos los input) */
.re-form input[type=color], .re-dlg input[type=color] { -webkit-appearance: none; appearance: none; width: 48px !important; height: 34px !important; padding: 2px !important; border: 1px solid #d1d5db; border-radius: 8px; background: #fff; cursor: pointer; }
.re-form input[type=color]::-webkit-color-swatch-wrapper, .re-dlg input[type=color]::-webkit-color-swatch-wrapper { padding: 0; }
.re-form input[type=color]::-webkit-color-swatch, .re-dlg input[type=color]::-webkit-color-swatch { border: 0; border-radius: 6px; }
.re-form input[type=color]::-moz-color-swatch, .re-dlg input[type=color]::-moz-color-swatch { border: 0; border-radius: 6px; }
.re-form input[type=color]:disabled { opacity: .4; cursor: default; }

/* Tamaño del mapa elegido en el Admin: solo en computadora (en celulares y tabletas se ajusta solo) */
@media (min-width: 900px) {
  .rt-map[data-size] { width: var(--rt-w, 100%); max-width: 100%; margin-left: auto; margin-right: auto; }
  .rt-map[data-size*="h"] { height: var(--rt-h); min-height: 0; }
}
.rt-size { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.rt-size label { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-weight: 400; }
.rt-size input { width: 96px !important; }
.rt-size select { width: auto !important; }

/* Lupa sobre las fotos de las etiquetas */
.mrl-imgw { position: relative; display: inline-block; line-height: 0; }
.mrl-zoom { position: absolute; right: -4px; bottom: -4px; width: 26px; height: 26px; padding: 0; border: 2px solid #fff; border-radius: 50%; background: rgba(17,17,17,.82); color: #fff; display: flex; align-items: center; justify-content: center; cursor: zoom-in; pointer-events: auto; box-shadow: 0 1px 4px rgba(0,0,0,.45); }
.mrl-zoom:hover, .mrl-zoom:focus-visible { background: #111; transform: scale(1.12); outline: none; }
@media (pointer: coarse) { .mrl-zoom { width: 32px; height: 32px; right: -6px; bottom: -6px; } }

/* Descripción de la ruta con HTML */
.rt-desc-html { font-size: 1rem; }
.rt-desc-html img { max-width: 100%; height: auto; border-radius: 8px; }
.rt-desc-html table { width: 100%; border-collapse: collapse; display: block; overflow-x: auto; margin: 0 0 1.1em; }
.rt-desc-html th, .rt-desc-html td { border: 1px solid var(--border, #e5e7eb); padding: 6px 10px; text-align: left; vertical-align: top; }
.re-desc-field .re-desc-html { margin: 0 0 6px; font-size: .88rem; }
.re-desc-field .desc-toolbar button { padding: 5px 7px; font-size: .78rem; }
/* Tarjetas de la página «Rutas»: la descripción con formato se ve recortada (el resto en «Ver ruta») */
.rt-card-desc { position: relative; max-height: 16em; overflow: hidden; margin: 6px 0 4px; font-size: .95rem; }
.rt-card-desc::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3em; background: linear-gradient(rgba(255,255,255,0), var(--surface, #fff)); pointer-events: none; }
.rt-card-desc h1, .rt-card-desc h2 { font-size: 1.15rem; margin: .6em 0 .3em; }
.rt-card-desc h3 { font-size: 1.02rem; margin: .5em 0 .25em; }
.rt-card-desc iframe, .rt-card-desc .blog-video, .rt-card-desc .route-embed { display: none; }

/* Tour animado */
.mr-tour { position: absolute; left: 50%; bottom: 26px; transform: translateX(-50%); z-index: 800; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: center; max-width: calc(100% - 24px); padding: 6px 8px 10px; background: rgba(255,255,255,.96); border-radius: 14px; box-shadow: 0 4px 16px rgba(0,0,0,.28); font: 600 14px/1.2 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; color: #111; }
.mr-t-play { min-height: 44px; padding: 0 18px; border: 0; border-radius: 22px; background: #c1121f; color: #fff; font: 700 15px/1 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; }
.mr-tour.is-running .mr-t-play { background: #111; }
.mr-tour.is-paused .mr-t-play { background: #2b9348; }
.mr-t-btn { width: 40px; height: 40px; border: 1px solid #d1d5db; border-radius: 50%; background: #fff; color: #111; font-size: 18px; line-height: 1; cursor: pointer; padding: 0; }
.mr-tour:not(.is-running) .mr-t-btn, .mr-tour:not(.is-running) .mr-t-bar { display: none; }
.mr-t-info { min-width: 0; padding: 0 4px; font-variant-numeric: tabular-nums; }
.mr-t-info:empty { display: none; }
.mr-t-bar { position: absolute; left: 12px; right: 12px; bottom: 4px; height: 3px; border-radius: 2px; background: #e5e7eb; overflow: hidden; }
.mr-t-bar i { display: block; height: 100%; width: 0; background: #c1121f; }
.mr-t-dot { filter: drop-shadow(0 1px 3px rgba(0,0,0,.5)); }
.mrl-active .mrl-svg { animation: mrl-pulse 1.2s ease-in-out infinite; }
@keyframes mrl-pulse { 50% { filter: drop-shadow(0 0 10px rgba(255,214,10,.95)); } }
@media (prefers-reduced-motion: reduce) { .mrl-active .mrl-svg { animation: none; } }
.mr-tour { flex-wrap: nowrap; white-space: nowrap; }
@media (max-width: 480px) {
  .mr-tour { gap: 4px; padding: 5px 6px 9px; font-size: 13px; bottom: 22px; }
  .mr-t-play { padding: 0 12px; font-size: 14px; }
  .mr-t-btn { width: 36px; height: 36px; font-size: 16px; }
}
.re-tour-zse-box.is-off { opacity: .45; }

/* Tour: las líneas no se recortan ni se redibujan mientras el mapa se desplaza (evita que «salten») */
.leaflet-overlay-pane svg { overflow: visible; }
.mr-t-dotw { background: none; border: 0; }
.mr-t-dot { display: block; width: 22px; height: 22px; box-sizing: border-box; border: 4px solid #fff; border-radius: 50%; box-shadow: 0 1px 4px rgba(0,0,0,.5); will-change: transform; }

/* Música del tour */
.mr-t-snd { font-size: 17px; }
.mr-tour.needs-sound .mr-t-snd { animation: mr-snd 1s ease-in-out infinite; border-color: #c1121f; }
@keyframes mr-snd { 50% { transform: scale(1.15); } }
.re-music-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 4px 0; }
.re-music-row audio { height: 34px; max-width: 100%; }

/* ---------- Para el visitante ---------- */
.rt-times { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin: 4px 0 0; font-size: .95rem; }
.rt-times-l { color: var(--muted, #6b7280); }
.rt-time { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; white-space: nowrap; }
.rt-share { margin-top: 12px; }
.rt-share-links { display: flex; flex-wrap: wrap; gap: 8px; }
.rt-sh-wa { background: #25d366; border-color: #25d366; color: #fff; }
.rt-sh-fb { background: #1877f2; border-color: #1877f2; color: #fff; }
.rt-sh-x { background: #111; border-color: #111; color: #fff; }
.rt-qr { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border, #e5e7eb); }
.rt-qr img { width: 220px; max-width: 100%; height: auto; border-radius: 10px; border: 1px solid var(--border, #e5e7eb); background: #fff; }
.rt-qr > div { flex: 1 1 220px; }
.rt-qr-dl { display: flex; flex-wrap: wrap; gap: 8px; }
.rt-offline-status { margin: 8px 0 0; font-size: .92rem; }
#rt-offline-btn.is-saved { border-color: #2b9348; color: #1b6b2a; }
.linklike { background: none; border: 0; padding: 0; color: var(--primary, #1d4ed8); text-decoration: underline; cursor: pointer; font: inherit; }

/* Botones por categoría (puntos de interés y negocios) */
.rt-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 8px 0 0; }
.rt-filters-l { font-size: .85rem; color: var(--muted, #6b7280); margin-right: 2px; }
.rt-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px 4px 5px; border: 1px solid var(--border, #d1d5db); border-radius: 999px; background: var(--surface, #fff); font: 600 .85rem/1.2 inherit; color: inherit; cursor: pointer; min-height: 34px; }
.rt-chip svg { display: block; }
.rt-chip[aria-pressed=false] { opacity: .45; text-decoration: line-through; background: transparent; }
.rt-chip[aria-pressed=false] svg, .rt-chip[aria-pressed=false] .rt-biz { filter: grayscale(1); }

/* Negocios cerca */
.rt-biz-wrap { background: none; border: 0; }
.rt-biz { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%; background: #fff; border: 3px solid var(--primary, #1d4ed8); box-shadow: 0 1px 5px rgba(0,0,0,.4); overflow: hidden; box-sizing: border-box; }
.rt-biz img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.rt-biz span { font: 800 12px/1 system-ui, sans-serif; color: var(--primary, #1d4ed8); }
.rt-biz-sm { width: 20px; height: 20px; border-width: 2px; }
.rt-biz-sm span { font-size: 11px; }
.rt-near-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.rt-near-list li { display: flex; align-items: stretch; border: 1px solid var(--border, #e5e7eb); border-radius: 12px; overflow: hidden; }
.rt-near-item { flex: 1; display: flex; gap: 10px; align-items: center; padding: 10px; text-decoration: none; color: inherit; min-width: 0; }
.rt-near-item:hover strong { text-decoration: underline; }
.rt-near-logo { flex: 0 0 48px; width: 48px; height: 48px; border-radius: 10px; overflow: hidden; display: flex; align-items: center; justify-content: center; background: var(--surface-2, #f3f4f6); }
.rt-near-logo img { width: 100%; height: 100%; object-fit: contain; }
.rt-near-txt { display: flex; flex-direction: column; min-width: 0; }
.rt-near-txt strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rt-near-d { color: #2b9348; font-weight: 600; }
.rt-near-go { border: 0; border-left: 1px solid var(--border, #e5e7eb); background: var(--surface-2, #f8fafc); padding: 0 14px; font-size: 1.1rem; cursor: pointer; color: inherit; }
.rt-near-go:hover { background: #e0e7ff; }

/* ¿Dónde estoy? */
.rt-locate { width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; background: #fff; border: 2px solid rgba(0,0,0,.2); border-radius: 4px; background-clip: padding-box; cursor: pointer; color: #333; padding: 0; }
.rt-locate:hover { background-color: #f4f4f4; }
.rt-locate.is-on { color: #1a73e8; }
.rt-locate.is-on svg { animation: rt-loc 1.6s ease-in-out infinite; }
@keyframes rt-loc { 50% { opacity: .5; } }
.rt-you-wrap { background: none; border: 0; }
.rt-you { display: block; width: 22px; height: 22px; box-sizing: border-box; border-radius: 50%; background: #1a73e8; border: 4px solid #fff; box-shadow: 0 0 0 2px rgba(26,115,232,.35), 0 1px 4px rgba(0,0,0,.4); }
.rt-toast { position: absolute; left: 50%; top: 10px; transform: translateX(-50%); z-index: 850; max-width: calc(100% - 110px); padding: 7px 12px; border-radius: 10px; background: rgba(17,17,17,.88); color: #fff; font: 600 13px/1.3 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; text-align: center; box-shadow: 0 2px 10px rgba(0,0,0,.3); }
.rt-toast[hidden] { display: none; }

/* Narración de la etiqueta */
.mrl-narr { position: absolute; right: -10px; top: -10px; width: 30px; height: 30px; border-radius: 50%; border: 2px solid #fff; background: #111; color: #fff; font-size: 14px; line-height: 1; display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; pointer-events: auto; box-shadow: 0 1px 4px rgba(0,0,0,.45); }
.mrl-narr.is-on { background: #c1121f; animation: mr-snd 1s ease-in-out infinite; }
@media (pointer: coarse) { .mrl-narr { width: 36px; height: 36px; } }
.rt-filters.is-over { position: absolute; top: 8px; left: 54px; right: 54px; z-index: 700; margin: 0; justify-content: center; pointer-events: none; }
.rt-filters.is-over .rt-chip { pointer-events: auto; box-shadow: 0 1px 4px rgba(0,0,0,.25); font-size: .78rem; min-height: 30px; }
.rt-filters.is-over .rt-filters-l { display: none; }
.rt-filters.is-over .rt-chip[aria-pressed=false] { background: rgba(255,255,255,.85); opacity: .75; }
/* Admin › Negocios: ubicación en el mapa */
.ce-geo-row { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-end; }
.ce-geo-row .field { margin: 0; }
.ce-geo-map { height: 320px; border-radius: 10px; border: 1px solid var(--border, #e5e7eb); margin-top: 10px; z-index: 0; }
.ce-geo-res { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; margin-top: 8px; font-size: .9rem; }
/* Página «Rutas»: la tarjeta de la ruta que está en el mapa */
.rt-card.is-on { box-shadow: 0 0 0 3px var(--rt); }
.rt-card [data-focus] .rt-on-l { display: none; }
.rt-card [data-focus][aria-pressed="true"] .rt-on-l { display: inline; }
.rt-card [data-focus][aria-pressed="true"] .rt-off-l { display: none; }
.rt-card [data-focus][aria-pressed="true"] { background: var(--rt); border-color: var(--rt); color: #fff; }
