/* Mapa 4 · réplica de la app de mapa satelital (pantalla de referencia 393 × 750). */
* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; }
body.m4 { overflow: hidden; color: #fff; background: #0a0e12; font-family: Roboto, system-ui, -apple-system, 'Segoe UI', sans-serif; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
button, input { font: inherit; color: inherit; }
button { padding: 0; border: 0; background: none; cursor: pointer; }
svg { display: block; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Escenario de escritorio: teléfono centrado sobre el mismo paisaje desenfocado. */
.m4-stage { position: relative; display: grid; min-height: 100vh; min-height: 100dvh; place-items: center; overflow: hidden; }
.m4-stage::before { position: absolute; inset: -12%; z-index: -1; content: ''; background: url('https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/8/161/76') center / cover; filter: blur(46px) brightness(.5) saturate(.75); }
.m4-phone { position: relative; padding: 11px; border-radius: 64px; background: #030405; box-shadow: 0 0 0 1.5px #55595d, 0 0 0 4px #24272a, 0 0 0 5px #66696d, 0 40px 90px #000c; }
.m4-phone::before, .m4-phone::after { position: absolute; width: 4px; content: ''; border-radius: 2px; background: linear-gradient(90deg, #2a2d30, #6b6f73); }
.m4-phone::before { top: 150px; left: -9px; height: 62px; box-shadow: 0 78px 0 #44484c; }
.m4-phone::after { top: 210px; right: -9px; height: 96px; transform: scaleX(-1); }

.m4-screen {
  --top: 46.7px;
  --nav-h: 88px;
  --sheet-h: calc(162px + var(--nav-h));
  position: relative;
  width: 393px;
  height: min(750px, calc(100vh - 44px));
  height: min(750px, calc(100dvh - 44px));
  overflow: hidden;
  border-radius: 53px;
  background: #13242b;
  isolation: isolate;
}

/* Mapa */
#map { position: absolute; inset: 0; z-index: 0; background: #13242b; }
.leaflet-container { font-family: inherit; background: #13242b; }
.m4 .leaflet-tile-pane { filter: brightness(1.05) saturate(1.2) contrast(1.06); }
.m4 .leaflet-m4-tint-pane { background: #00121c; mix-blend-mode: screen; }
.m4-hillshade { mix-blend-mode: multiply; }
.m4 .leaflet-m4-shade-pane { background: linear-gradient(180deg, #050a0e9e 0, #050a0e52 70px, #050a0e1a 135px, #0000 190px), radial-gradient(130% 80% at 50% 45%, #0000 55%, #02060a66 100%); }

/* Barra de estado y Dynamic Island (solo en la maqueta de escritorio). */
.m4-status { position: absolute; top: 0; left: 0; right: 0; z-index: 5; height: 44px; pointer-events: none; }
.m4-time { position: absolute; top: 12.6px; left: 36.6px; display: flex; align-items: center; gap: 4px; font: 600 16.4px/19px -apple-system, 'SF Pro Text', Roboto, sans-serif; letter-spacing: -.2px; }
.m4-time svg { width: 13px; height: 13px; margin-top: 1px; }
.m4-status-icons { position: absolute; top: 16.4px; right: 27.6px; display: flex; align-items: center; gap: 5.6px; fill: #fff; color: #fff; }
.m4-signal { width: 17.6px; height: 11.4px; }
.m4-wifi { width: 15.6px; height: 11.4px; }
.m4-battery { width: 25.6px; height: 12.4px; margin-left: 1.4px; }
.m4-island { position: absolute; top: 5.6px; left: 50%; z-index: 5; width: 115px; height: 32.6px; transform: translateX(-50%); border-radius: 20px; background: #000; }
.m4-island i { position: absolute; top: 11.2px; right: 9.8px; width: 10px; height: 10px; border-radius: 50%; background: radial-gradient(circle at 40% 40%, #2a3a7a 0 18%, #0c1230 45%, #05060c 75%); }

/* Barra superior */
.m4-top { position: absolute; top: var(--top); left: 12.3px; right: 12.3px; z-index: 4; display: flex; align-items: center; height: 38.2px; }
.m4-yt { display: grid; flex: none; width: 43.3px; height: 37.3px; margin-right: 10.6px; place-items: center; border: 1px solid #ffffff1f; border-radius: 15px; background: #1f2f3fb8; box-shadow: 0 4px 14px #0006; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.m4-yt span { display: grid; width: 32.2px; height: 24.6px; place-items: center; border-radius: 7.4px; background: #e8161f; box-shadow: inset 0 1px 0 #ffffff26; }
.m4-yt svg { width: 22px; height: 22px; }
.m4-search { display: flex; flex: 1; align-items: center; min-width: 0; height: 37.3px; padding: 0 12px 0 13.4px; border: 1px solid #ffffff2b; border-radius: 19px; background: #26323ab8; box-shadow: 0 4px 16px #0005; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); cursor: text; }
.m4-search svg { flex: none; width: 17px; height: 17px; margin-right: 10px; fill: none; stroke: #c3cad1; stroke-width: 2; stroke-linecap: round; }
.m4-search input { width: 100%; min-width: 0; padding: 0; border: 0; outline: 0; color: #fff; background: transparent; font-size: 11.35px; letter-spacing: .05px; }
.m4-search input::placeholder { color: #b6bec6; opacity: 1; }
.m4-search input::-webkit-search-cancel-button { filter: invert(1) opacity(.6); }
.m4-round { display: grid; flex: none; width: 38.2px; height: 38.2px; margin-left: 12.7px; place-items: center; border: 1px solid #ffffff26; border-radius: 50%; background: #2a3338c2; box-shadow: 0 4px 14px #0006; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.m4-round svg { width: 19.4px; height: 19.4px; fill: none; stroke: #e9edf0; stroke-width: 1.8; stroke-linecap: round; }
.m4-round[aria-pressed="true"] { border-color: #6ea2ff99; background: #1b3354d9; }

/* Botones flotantes */
.m4-tools { position: absolute; top: calc(var(--top) + 59.8px); right: 8.4px; z-index: 4; display: grid; gap: 8.5px; }
.m4-tool, .m4-locate { display: grid; place-items: center; border-radius: 50%; color: #fff; background: #171b1ee6; box-shadow: 0 3px 12px #0008, inset 0 0 0 1px #ffffff12; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.m4-tool { width: 34px; height: 34px; }
.m4-tool svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.m4-tool-3d { font-size: 15.6px; font-weight: 500; letter-spacing: -.3px; }
.m4-tool[aria-pressed="true"] { color: #8db6ff; box-shadow: 0 3px 12px #0008, inset 0 0 0 1px #6ea2ff80; }
.m4-locate { position: absolute; right: 12.3px; bottom: calc(var(--sheet-h) + 17.8px); z-index: 4; width: 40px; height: 40px; background: #161a1bf0; }
.m4-locate svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.1; stroke-linecap: round; }

/* Escala */
.m4-scale { position: absolute; left: 16.6px; bottom: calc(var(--sheet-h) + 18px); z-index: 3; width: 92.4px; height: 24.4px; border-radius: 6px; background: #101313a6; pointer-events: none; font-size: 9.5px; }
.m4-scale span { position: absolute; top: 3.6px; line-height: 12px; transform: translateX(-50%); white-space: nowrap; }
.m4-scale-zero { left: 9.4px; }
.m4-scale-end { transform: translateX(-3.2px) !important; }
.m4-scale-bar { position: absolute; left: 9.4px; bottom: 5.1px; height: 6px; border: 1.4px solid #f1f3f2; border-top: 0; }
.m4-scale-bar::after { position: absolute; left: 50%; bottom: 0; width: 1.4px; height: 4.4px; content: ''; transform: translateX(-50%); background: #f1f3f2; }
.m4-attribution { position: absolute; left: 17px; bottom: calc(var(--sheet-h) + 4px); z-index: 3; color: #ffffff6b; font-size: 7px; pointer-events: none; }

/* Marcadores */
.m4-marker { border: 0; background: none; }
.m4-video { position: relative; width: 0; height: 0; cursor: pointer; }
.m4-card { position: absolute; display: block; overflow: hidden; border: 2.1px solid #fff; border-radius: 8.6px; background: #3b4a55; box-shadow: 0 4px 12px #000a; transition: transform .18s ease; }
.m4-card img { display: block; width: 100%; height: 100%; object-fit: cover; }
.m4-video:hover .m4-card, .m4-video.is-selected .m4-card { transform: translateY(-2px); }
.m4-video.is-selected .m4-card { border-color: #fff; box-shadow: 0 0 0 2px #ffffff40, 0 6px 16px #000c; }
.m4-yt-mini { position: absolute; display: block; border-radius: 3.6px; background: #e8161f; box-shadow: 0 1px 3px #0005; }
.m4-yt-mini::after { position: absolute; top: 50%; left: 50%; content: ''; border-top: 3.3px solid transparent; border-bottom: 3.3px solid transparent; border-left: 5.6px solid #fff; transform: translate(-36%, -50%); }
.m4-card .m4-yt-mini { left: 3.4px; bottom: 2px; width: 17.6px; height: 13.2px; }
.m4-tail { position: absolute; width: 0; height: 0; border-top: 5px solid #fff; border-right: 3.4px solid transparent; border-left: 3.4px solid transparent; transform: translateX(-50%); }
.m4-dot { position: absolute; top: -6.6px; left: -6.6px; z-index: 2; display: grid; width: 13.2px; height: 13.2px; place-items: center; border: 1.6px solid #fff; border-radius: 50%; box-shadow: 0 1px 4px #0009; }
.m4-dot::after { width: 4.4px; height: 4.4px; content: ''; border-radius: 50%; background: #fff; }
.m4-dot.blue { background: #0a77ee; }
.m4-dot.green { background: #10a54a; }
.m4-dot.purple { background: #9430f6; }
.m4-dot.orange { background: #f0921a; }
.m4-dot.purple::after { width: 6px; height: 4.6px; border-radius: 1.6px 1.6px 1.6px 0; }
.m4-dot.orange::after { width: 5px; height: 5.6px; border-radius: 1px 1px 50% 50%; }
.m4-label { position: absolute; top: -8.4px; z-index: 1; height: 16.8px; padding: 0 6px; border-radius: 5px; color: #fff; background: #0a10167a; font-size: 10.5px; font-weight: 500; line-height: 16.8px; letter-spacing: .05px; white-space: nowrap; text-shadow: 0 1px 2px #0009; }
.m4-label.right { left: 0; padding-left: 10.9px; }
.m4-label.left { right: 0; padding-right: 9.9px; }
.m4-label.below-left { top: -0.8px; right: 8.1px; }
.m4-video.is-dim { opacity: .28; }

.m4-town { position: relative; width: 0; height: 0; cursor: pointer; }
.m4-town-halo { position: absolute; top: -12px; left: -12px; width: 24px; height: 24px; border-radius: 50%; background: radial-gradient(circle, #ff4a4d70 0 40%, #ff4a4d26 62%, #ff4a4d00 72%); animation: m4-pulse 2.4s ease-out infinite; }
.m4-town-dot { position: absolute; top: -4.8px; left: -4.8px; width: 9.6px; height: 9.6px; border: 1.3px solid #ffd7d7; border-radius: 50%; background: #ec3437; box-shadow: 0 1px 4px #0008; }
.m4-town-pin { position: absolute; top: -30px; left: -10.6px; width: 20.4px; height: 25px; filter: drop-shadow(0 2px 3px #0009); }
.m4-town-label { position: absolute; top: -28.2px; left: 10px; height: 20.4px; padding: 0 4.3px 0 6.3px; border-radius: 6px; color: #fff; background: #0a10168a; font-size: 12.2px; font-weight: 500; line-height: 20.4px; white-space: nowrap; text-shadow: 0 1px 2px #0009; }
@keyframes m4-pulse { 0% { transform: scale(.75); opacity: 1; } 100% { transform: scale(1.35); opacity: .35; } }

.m4-photo { width: 24px !important; height: 24px !important; overflow: hidden; border: 1.8px solid #fff; border-radius: 50%; background: #34444f; box-shadow: 0 2px 7px #0009; }
.m4-photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.m4-wp { display: grid !important; width: 13.2px !important; height: 13.2px !important; place-items: center; border: 1.6px solid #fff; border-radius: 50%; background: #4b4e53; box-shadow: 0 1px 4px #0008; }
.m4-wp::after { width: 4.4px; height: 4.4px; content: ''; border-radius: 1.3px; background: #fff; }
.m4-wp.is-faint { border-width: 1.2px; background: #ffffff1c; box-shadow: none; }
.m4-wp.is-faint::after { display: none; }

/* Hoja inferior */
.m4-sheet { position: absolute; left: 0; right: 0; bottom: 0; z-index: 6; height: var(--sheet-h); border-radius: 24px 24px 0 0; background: linear-gradient(180deg, #1b1f23f7 0, #171b1ef7 45%, #121619 100%); box-shadow: 0 -10px 30px #0006, inset 0 1px 0 #ffffff14; }
.m4-handle { position: absolute; top: 12px; left: 50%; width: 35.7px; height: 4px; transform: translateX(-50%); border-radius: 2px; background: #50555b; }
.m4-feature { position: absolute; inset: 0 0 auto; height: 116px; color: inherit; text-decoration: none; }
.m4-thumb { position: absolute; top: 20.4px; left: 18.9px; width: 139.6px; height: 90.4px; overflow: hidden; border-radius: 12.4px; background: #2b3540; box-shadow: 0 4px 14px #0007; }
.m4-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.m4-yt-thumb { left: 6.8px; bottom: 5.6px; width: 23px; height: 17px; border-radius: 4.4px; }
.m4-yt-thumb::after { border-top-width: 4.3px; border-bottom-width: 4.3px; border-left-width: 7.2px; }
.m4-duration { position: absolute; right: 6.4px; bottom: 6.4px; height: 19.5px; padding: 0 5.6px; border-radius: 4.6px; color: #fff; background: #0a0d10c4; font-size: 12.1px; font-weight: 500; line-height: 19.5px; letter-spacing: .2px; }
.m4-feature-text { position: absolute; top: 0; left: 175.3px; width: 150px; }
.m4-feature-text strong { position: absolute; top: 30.2px; left: 0; display: -webkit-box; overflow: hidden; color: #f5f6f7; font-size: 15.4px; font-weight: 500; line-height: 18.4px; letter-spacing: .05px; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.m4-meta { position: absolute; left: 0; display: flex; align-items: center; height: 14px; color: #b9c1ca; font-size: 10.2px; white-space: nowrap; }
.m4-meta svg { flex: none; margin-right: 6.6px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.m4-meta-place { top: 73px; }
.m4-meta-place svg { width: 11px; height: 12.4px; margin-left: -1.2px; margin-right: 5.6px; }
.m4-meta-date { top: 91px; }
.m4-meta-date svg { width: 11.4px; height: 11.4px; margin-left: -.6px; margin-right: 5.6px; }
.m4-chevron { position: absolute; top: 53px; right: 17.6px; width: 14px; height: 14px; fill: none; stroke: #e5e8eb; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.m4-tags { position: absolute; top: 121.9px; left: 20.4px; right: 12px; display: flex; gap: 9.4px; overflow-x: auto; scrollbar-width: none; }
.m4-tags::-webkit-scrollbar { display: none; }
.m4-tags button { flex: none; height: 26.3px; padding: 0 13.2px; border: 1px solid #ffffff1a; border-radius: 13.2px; color: #e7eaed; background: #1f252af2; font-size: 10.7px; letter-spacing: .1px; }
.m4-tags button:hover { background: #283038; }

/* Navegación inferior */
.m4-tabs { position: absolute; left: 0; right: 0; bottom: 0; z-index: 7; display: grid; grid-template-columns: repeat(4, 1fr); align-items: start; gap: 2.6px; height: var(--nav-h); padding: 5px 4.7px 0; border-radius: 22px 22px 0 0; background: linear-gradient(180deg, #111417 0, #0b0e11 35%, #090c0f 100%); box-shadow: 0 -1px 0 #ffffff08; }
.m4-tab { position: relative; display: flex; flex-direction: column; align-items: center; height: 51px; padding-top: 7.4px; border-radius: 15px; color: #a8b0b9; }
.m4-tab svg { width: 20.4px; height: 20.4px; fill: none; stroke: currentColor; stroke-width: 1.85; stroke-linecap: round; stroke-linejoin: round; }
.m4-tab span { margin-top: 5.4px; font-size: 10px; line-height: 13px; letter-spacing: .1px; }
.m4-tab.is-active { color: #fff; background: radial-gradient(60% 75% at 50% 32%, #1b4479 0, #17304f 55%, #15233a 100%); box-shadow: inset 0 1px 0 #3f7fd2, inset 0 0 0 1px #2b5a9655, 0 0 18px #1d55b02e; }
.m4-tab.is-active svg { color: #7fabff; filter: drop-shadow(0 0 4px #3d7bff99); }
.m4-home { position: absolute; left: 50%; bottom: 6.5px; z-index: 8; width: 143px; height: 5.1px; transform: translateX(-50%); border-radius: 3px; background: #fff; }

/* En el teléfono: la app ocupa toda la pantalla, sin marco ni barra de estado falsa. */
@media (max-width: 520px) {
  .m4-stage { display: block; min-height: 0; }
  .m4-stage::before { display: none; }
  .m4-phone { padding: 0; border-radius: 0; background: none; box-shadow: none; }
  .m4-phone::before, .m4-phone::after, .m4-status, .m4-island, .m4-home { display: none; }
  .m4-screen { --top: max(12px, calc(env(safe-area-inset-top) + 8px)); --nav-h: calc(58px + max(14px, env(safe-area-inset-bottom))); position: fixed; inset: 0; width: 100%; height: 100%; border-radius: 0; }
  .m4-top { left: max(12.3px, env(safe-area-inset-left)); right: max(12.3px, env(safe-area-inset-right)); }
}
