/* IDENTIDAD PROVISIONAL. Modo claro = dirección A "Valle"; modo oscuro = dirección C "Farol".
   Todo el aspecto sale de estas variables: cambiar la identidad = cambiar estos dos bloques. */
:root {
  --ink: #16302B; --muted: #4A655D; --bg: #E9F2EC; --surface: #FFFFFF; --line: #D3E4DA; --map: #E3EFE7;
  --mango: #F2A33A; --rose: #F0A6B8; --sky: #8CC6E3; --lime: #A8D68A;
  --moved-bg: #FFE7BD; --moved-fg: #6A4200; --new-bg: #D8EFC8; --new-fg: #27501A;
  --open: #1E6B44; --closed: #8A4B2A;
  --r-lg: 28px; --r-md: 20px; --r-pill: 999px;
  --font-display: 'Gabarito', system-ui, sans-serif; --font-body: 'Figtree', system-ui, sans-serif;
  --pad: clamp(16px, 3vw, 28px);
  /* relleno de controles activos, acento y estados */
  --strong: #16302B; --on-strong: #FFFFFF; --accent: #F2A33A; --on-accent: #16302B;
  --hover: #F1F7F3; --hover-chip: #DCEBE2; --sel-bg: #EAF4EE; --sel-ring: #16302B; --pin-glow: none;
  /* mapa esquemático */
  --mb-land: #E3EFE7; --mb-water: #BFE0EE; --mb-park: #CDE6D4; --mb-road: #FFFFFF; --mb-road2: #FFFFFF; --mb-label: #3E5A52; --mb-casing: #D3E4DA; --mb-building: #DCEBE2;
  /* marca Nubi (mascota Dúo y logotipo) */
  --nb-body: #A8D68A; --nb-lobe: #F2A33A; --nb-face: #16302B; --nb-muted: #4A655D; --nb-rose: #F0A6B8; --nb-sky: #8CC6E3; --nb-bubble: #FFFFFF; --nb-bubble-line: #CFE3EC;
  --geo: #1C6790; /* tu ubicación (Módulo 01): azul «cielo» de la paleta de perfiles */
  color-scheme: light;
}
:root[data-theme="dark"] {
  --ink: #EAF2EF; --muted: #9DB3AD; --bg: #0F1A22; --surface: #17262F; --line: #2A3E49; --map: #12202A;
  --moved-bg: #3B3014; --moved-fg: #FFD47A; --new-bg: #1E3A2C; --new-fg: #8FD6B5; --open: #8FD6B5; --closed: #E0A58B;
  --strong: #FFD47A; --on-strong: #0F1A22; --accent: #FFD47A; --on-accent: #0F1A22;
  --hover: #1F3340; --hover-chip: #223A47; --sel-bg: #1F3340; --sel-ring: #FFFFFF;
  --pin-glow: 0 0 0 6px rgba(255,212,122,.20), 0 0 24px rgba(255,212,122,.55);
  --mb-land: #12202A; --mb-water: #14384A; --mb-park: #143028; --mb-road: #1F3643; --mb-road2: #1B303C; --mb-label: #7FA39A; --mb-casing: #2A3E49; --mb-building: #17262F;
  --nb-lobe: #FFD47A; --nb-face: #0F1A22; --nb-muted: #9DB3AD; --nb-bubble: #EAF2EF; --nb-bubble-line: #9DB3AD;
  --geo: #8CC6E3;
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font-body); font-size: 16px; line-height: 1.4; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--strong); color: var(--on-strong); padding: 8px 14px; border-radius: var(--r-pill); z-index: 100; }
.skip:focus { left: 8px; }
.muted { color: var(--muted); }

/* Barra superior */
.topbar { display: flex; align-items: center; gap: 12px; padding: 12px var(--pad); background: var(--surface); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; text-decoration: none; color: var(--ink); flex: 0 0 auto; }
.brand svg { display: block; height: 30px; width: auto; max-width: 100%; overflow: visible; }
.hero-mascot { flex: 0 0 auto; align-self: flex-end; width: clamp(92px, 11vw, 132px); }
.hero-mascot svg, .empty-mascot svg { display: block; width: 100%; height: auto; overflow: visible; }
.empty-mascot { width: 96px; margin: 0 0 8px; }
.pill-demo { margin: 0 0 0 auto; background: var(--strong); color: var(--on-strong); border-radius: var(--r-pill); padding: 6px 14px; font-size: 13px; font-weight: 500; text-align: center; }

/* Botones */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 20px; border-radius: var(--r-pill); border: 0; background: var(--strong); color: var(--on-strong); font-weight: 600; font-size: 15px; text-decoration: none; }
.btn--accent { background: var(--accent); color: var(--on-accent); }
.btn--ghost { background: transparent; color: var(--ink); border: 2px solid var(--ink); }

/* Hero: título, búsqueda, filtros y ayudante */
.hero { display: flex; gap: 20px; align-items: flex-start; padding: 20px var(--pad) 8px; }
.hero-main { flex: 1; min-width: 0; }
h1 { margin: 0 0 14px; font-family: var(--font-display); font-weight: 700; font-size: clamp(26px, 4vw, 40px); line-height: 1.1; letter-spacing: -.01em; }
.search { display: flex; align-items: center; gap: 10px; max-width: 560px; height: 48px; padding: 0 18px; background: var(--surface); border-radius: var(--r-pill); }
.search input { flex: 1; min-width: 0; border: 0; background: transparent; font-size: 16px; text-overflow: ellipsis; }
.search input:focus-visible { outline: none; }
.search:focus-within { outline: 3px solid var(--ink); outline-offset: 2px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.chip { min-height: 40px; padding: 0 16px; border: 0; border-radius: var(--r-pill); background: var(--surface); font-weight: 500; font-size: 14px; }
.chip:hover { background: var(--hover-chip); }
.chip[aria-pressed="true"] { background: var(--strong); color: var(--on-strong); }
.chip--open { border: 2px solid var(--accent); min-height: 40px; }
.chip--open[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }


/* Selector Lista/Mapa (solo en pantallas pequeñas) */
.viewtoggle { display: none; gap: 4px; margin: 8px var(--pad) 0; padding: 4px; background: var(--surface); border-radius: var(--r-pill); width: fit-content; }
.viewtoggle button { min-height: 40px; padding: 0 22px; border: 0; border-radius: var(--r-pill); background: transparent; font-weight: 600; }
.viewtoggle button[aria-pressed="true"] { background: var(--strong); color: var(--on-strong); }

/* Descubrir: lista + mapa */
.discover { display: flex; gap: 16px; padding: 16px var(--pad) 28px; height: min(760px, calc(100vh - 200px)); min-height: 540px; }
.panel { flex: 0 1 400px; min-width: 300px; display: flex; flex-direction: column; background: var(--surface); border-radius: var(--r-lg); padding: 16px 12px 12px; overflow: hidden; }
.count { margin: 0 8px 8px; font-size: 14px; color: var(--muted); font-weight: 500; }
.list { list-style: none; margin: 0; padding: 0; overflow: auto; display: flex; flex-direction: column; gap: 4px; }
.card { position: relative; border-radius: 18px; }
.card.is-sel { background: var(--sel-bg); }
.card-main { display: flex; flex-direction: column; gap: 4px; width: 100%; text-align: left; border: 0; background: transparent; padding: 12px 14px 8px; border-radius: 18px; }
.card-main:hover { background: var(--hover); }
.card-name { font-family: var(--font-display); font-weight: 600; font-size: 17px; }
.card-blurb { font-size: 14px; color: var(--muted); }
.card-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 13px; }
.card-link { display: inline-block; margin: 0 14px 10px; font-size: 14px; font-weight: 600; }
.status { font-weight: 600; }
.status.is-open { color: var(--open); } .status.is-closed { color: var(--closed); }
.tag { border-radius: var(--r-pill); padding: 2px 10px; font-weight: 500; }
.tag--moved { background: var(--moved-bg); color: var(--moved-fg); } .tag--new { background: var(--new-bg); color: var(--new-fg); }
.empty { margin: 12px 14px; }
/* Estado vacío del lanzamiento (0 negocios publicados) */
.launch-empty { margin: 0 var(--pad) 12px; padding: 16px 18px; border-radius: var(--r-md); background: var(--moved-bg); color: var(--moved-fg); }
.launch-empty-t { margin: 0 0 6px; font-family: var(--font-display); font-weight: 700; font-size: 18px; line-height: 1.3; }
.launch-empty p { margin: 0 0 12px; }
.launch-empty .btn { display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; }
#chips button:disabled { opacity: .5; cursor: default; }
.empty-title { margin: 0 0 4px; font-family: var(--font-display); font-weight: 600; font-size: 18px; }
.empty p { margin: 0; color: var(--muted); }

.mapwrap { flex: 1 1 480px; min-width: 0; position: relative; border-radius: var(--r-lg); overflow: hidden; background: var(--map); }
.mapwrap .map { position: absolute; inset: 0; } /* gana a .maplibregl-map { position: relative } */
.map-bg { position: absolute; inset: 0; width: 100%; height: 100%; }
.pins { position: absolute; inset: 0; }
.map-home { position: absolute; top: 12px; left: 12px; z-index: 6; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border: 0; background: var(--surface); color: var(--ink); border-radius: var(--r-pill); font-weight: 600; font-size: 14px; box-shadow: 0 2px 10px rgba(22,48,43,.18); }
.map-home:hover { background: var(--hover); }
.map-status { position: absolute; top: 60px; left: 12px; z-index: 6; margin: 0; max-width: min(360px, calc(100% - 24px)); padding: 8px 14px; background: var(--moved-bg); color: var(--moved-fg); border-radius: 16px; font-size: 13px; line-height: 1.35; }
.demo-note { margin: 0 0 8px; padding: 8px 12px; background: var(--moved-bg); color: var(--moved-fg); border-radius: 12px; font-size: 14px; }
.maplibregl-ctrl-top-right { top: 4px; right: 4px; }
/* Zoom del mapa con objetivo táctil de 40 px (MapLibre trae 29 px) */
.mapwrap .maplibregl-ctrl-group button { width: 40px; height: 40px; }
/* Punto de lugar (marca: «punto flotante»). Una esfera con anillo blanco que flota sobre su sombra;
   la sombra marca el lugar exacto (el marcador se ancla abajo). Nunca una gota con punta. */
.pin { display: flex; flex-direction: column; align-items: center; gap: 4px; border: 0; background: transparent; padding: 8px 8px 4px; -webkit-tap-highlight-color: transparent; }
.pin--svg { position: absolute; transform: translate(-50%, -100%); }
.pin .drop { position: relative; display: block; width: 24px; height: 24px; border-radius: 50%; background: var(--pin); border: 3px solid #fff; box-shadow: 0 4px 10px rgba(22,48,43,.22), var(--pin-glow); transition: transform .2s cubic-bezier(.23, 1, .32, 1); }
.pin .drop::before { content: ''; position: absolute; left: 3px; top: 3px; width: 7px; height: 4.5px; border-radius: 50%; background: #fff; opacity: .5; transform: rotate(-30deg); }
.pin::after { content: ''; width: 12px; height: 4px; border-radius: 50%; background: rgba(22,48,43,.22); transition: transform .2s cubic-bezier(.23, 1, .32, 1); }
.pin.is-closed .drop { box-shadow: 0 4px 10px rgba(22,48,43,.22); }
.pin.is-sel .drop { border-color: var(--sel-ring); transform: translateY(-3px) scale(1.25); }
.pin.is-sel::after { transform: scale(.8); }
.pin.is-closed { opacity: .55; }
.pin.is-closed.is-sel { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .pin .drop, .pin::after { transition: none; } }
.selcard { position: absolute; left: 16px; bottom: 16px; width: 340px; max-width: calc(100% - 32px); padding: 18px; background: var(--surface); border-radius: 24px; box-shadow: 0 8px 28px rgba(22,48,43,.16); display: flex; flex-direction: column; gap: 8px; z-index: 5; }
.selcard h3 { margin: 0; font-family: var(--font-display); font-weight: 700; font-size: 21px; }
.selcard p { margin: 0; }

/* Perfil */
.profile { max-width: 1040px; margin: 0 auto; padding: 16px var(--pad) 40px; display: flex; flex-direction: column; gap: 16px; }
.back { align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 18px 0 14px; background: var(--surface); border-radius: var(--r-pill); font-weight: 600; text-decoration: none; }
.cover { background: var(--cat); border-radius: 32px; padding: clamp(24px, 5vw, 44px); display: flex; flex-direction: column; gap: 12px; }
.cover h1 { margin: 0; font-size: clamp(30px, 6vw, 46px); }
.cover p { margin: 0; font-size: 18px; max-width: 560px; }
.profile-grid { display: flex; flex-wrap: wrap; gap: 16px; }
.panel-card { flex: 1 1 300px; background: var(--surface); border-radius: var(--r-lg); padding: 24px; display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.panel-card h2 { margin: 0; font-family: var(--font-display); font-size: 20px; }
.panel-card p { margin: 0; }
.panel-card dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; }
.panel-card dt { color: var(--muted); } .panel-card dd { margin: 0; font-weight: 500; }
.placeholder { color: var(--muted); font-style: italic; }

/* Móvil y tablet */
@media (max-width: 900px) {
  .viewtoggle { display: flex; }
  .discover { flex-direction: column; height: auto; min-height: 0; }
  .discover[data-pane="list"] .mapwrap, .discover[data-pane="map"] .panel { display: none; }
  .panel { flex: 1 1 auto; min-width: 0; }
  .list { overflow: visible; }
  .mapwrap { flex: 0 0 auto; height: min(70vh, 560px); min-height: 380px; }
  .topbar { flex-wrap: wrap; }
  .pill-demo { font-size: 12px; padding: 6px 10px; }
}
@media (max-width: 640px) { .hero-mascot { display: none; } }
@media (max-width: 360px) { .search { padding: 0 14px; gap: 8px; } .search input { font-size: 15px; } }
@media (max-width: 560px) {
  .hero { gap: 12px; }
  .brand svg { height: 26px; }
}

/* Colores del mapa esquemático y de la mascota por tema */
.mb-land { fill: var(--mb-land); } .mb-water { fill: var(--mb-water); } .mb-park { fill: var(--mb-park); } .mb-label { fill: var(--mb-label); }
.mb-road { stroke: var(--mb-road); } .mb-road2 { stroke: var(--mb-road2); }

/* Botón de tema */
.btn--icon { padding: 0; width: 44px; }
.btn--icon .i-sun { display: none; }
:root[data-theme="dark"] .btn--icon .i-sun { display: block; } :root[data-theme="dark"] .btn--icon .i-moon { display: none; }

/* La portada del perfil es un color pastel: el texto siempre es oscuro, en ambos modos */
.cover { color: #16302B; }
.cover .status.is-open { color: #1E6B44; } .cover .status.is-closed { color: #8A4B2A; }
.cover .tag--moved { background: #FFE7BD; color: #6A4200; } .cover .tag--new { background: #D8EFC8; color: #27501A; }

/* ===== Navegación principal (Explorar, Guardados, ayudante, Negocio, Ajustes) ===== */
.nav { display: flex; align-items: center; gap: 4px; margin-right: auto; }
@media (min-width: 1025px) { .topbar .pill-demo { margin-left: 0; } }
.nav a { position: relative; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border-radius: var(--r-pill); text-decoration: none; font-weight: 600; font-size: 15px; color: var(--muted); }
.nav a:hover { color: var(--ink); background: var(--hover); }
.nav a[aria-current="page"] { color: var(--ink); background: var(--sel-bg); }
.nav a svg { width: 20px; height: 20px; flex: none; }
.nav-badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: var(--r-pill); background: var(--accent); color: var(--on-accent); font-size: 12px; font-weight: 700; display: inline-grid; place-items: center; }

/* La mascota: en escritorio flota abajo a la derecha; en móvil encaja en el hueco central de la barra */
.dock { position: fixed; right: 24px; bottom: 24px; z-index: 40; display: flex; flex-direction: column; align-items: center; gap: 4px; border: 0; padding: 0; background: transparent; color: var(--ink); font-weight: 600; font-size: 12px; }
.dock-fig { display: block; width: 76px; height: 76px; padding: 4px; border-radius: 50%; background: var(--surface); box-shadow: 0 8px 24px rgba(22,48,43,.20), 0 0 0 1px var(--line); transition: box-shadow .2s; }
.dock-fig svg { display: block; width: 100%; height: 100%; overflow: visible; }
.dock-lbl { padding: 2px 10px; border-radius: var(--r-pill); background: var(--surface); box-shadow: 0 0 0 1px var(--line); }
.dock[aria-expanded="true"] .dock-fig { box-shadow: 0 0 0 3px var(--accent), 0 8px 24px rgba(22,48,43,.20); }
.dock:focus-visible { outline: none; } .dock:focus-visible .dock-fig { outline: 3px solid var(--ink); outline-offset: 3px; }

@media (max-width: 1024px) {
  /* 92 px de barra + 30 px que la mascota sobresale por encima: el final de cada página queda visible */
  body { padding-bottom: calc(124px + env(safe-area-inset-bottom)); }
  .nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; margin: 0; gap: 0; align-items: flex-end; padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); }
  /* fondo con un hueco circular donde encaja la mascota (como el punto de Encaje) */
  .nav::before { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(var(--line), var(--line)) top / 100% 1px no-repeat, var(--surface);
    -webkit-mask: radial-gradient(circle 42px at 50% 0, transparent 41px, #000 42px); mask: radial-gradient(circle 42px at 50% 0, transparent 41px, #000 42px); }
  .nav a { flex: 1 1 0; min-width: 0; flex-direction: column; gap: 2px; min-height: 56px; padding: 4px 2px; border-radius: 14px; font-size: 11.5px; justify-content: center; }
  .nav a:hover, .nav a[aria-current="page"] { background: transparent; }
  .nav a svg { width: 22px; height: 22px; padding: 3px 14px; box-sizing: content-box; border-radius: var(--r-pill); }
  .nav a[aria-current="page"] svg { background: var(--hover-chip); }
  .nav-badge { position: absolute; top: 0; left: calc(50% + 8px); min-width: 18px; height: 18px; font-size: 11px; }
  .dock { position: relative; right: auto; bottom: auto; flex: 0 0 84px; margin-bottom: 4px; font-size: 11.5px; }
  .dock-fig { width: 64px; height: 64px; padding: 3px; margin-top: -30px; }
  .dock-lbl { padding: 0; background: none; box-shadow: none; }
}

/* ===== Ayudante ===== */
.assist { position: fixed; z-index: 45; right: 24px; bottom: 140px; width: min(400px, calc(100vw - 20px)); max-height: min(600px, calc(100vh - 230px)); display: flex; flex-direction: column; background: var(--surface); border-radius: 28px; overflow: hidden;
  box-shadow: 0 18px 50px rgba(22,48,43,.25), 0 0 0 1px var(--line); transform-origin: calc(100% - 40px) 100%; animation: assist-in .18s ease-out; }
:root[data-theme="dark"] .assist { box-shadow: 0 18px 50px rgba(0,0,0,.55), 0 0 0 1px var(--line); }
@keyframes assist-in { from { opacity: 0; transform: translateY(10px) scale(.97); } }
.assist-head { display: flex; align-items: center; gap: 12px; padding: 12px 10px 10px 14px; border-bottom: 1px solid var(--line); }
.assist-fig { width: 46px; height: 46px; flex: none; } .assist-fig svg { width: 100%; height: 100%; display: block; overflow: visible; }
.assist-head h2 { margin: 0; font-family: var(--font-display); font-size: 19px; }
.assist-head h2:focus { outline: none; }
.assist-head p { margin: 0; font-size: 12.5px; color: var(--muted); }
.assist-close { margin-left: auto; flex: none; width: 44px; height: 44px; border: 0; border-radius: 50%; background: transparent; display: grid; place-items: center; }
.assist-close:hover { background: var(--hover); }
.assist-log { flex: 1; min-height: 140px; overflow-y: auto; overscroll-behavior: contain; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 92%; font-size: 15px; line-height: 1.45; }
.msg p { margin: 0; }
.msg--bot { align-self: flex-start; background: var(--bg); padding: 10px 14px; border-radius: 6px 20px 20px 20px; }
.msg--me { align-self: flex-end; background: var(--strong); color: var(--on-strong); padding: 8px 14px; border-radius: 20px 20px 6px 20px; }
.msg-acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chip--sm { display: inline-flex; align-items: center; min-height: 36px; padding: 0 12px; font-size: 13.5px; text-decoration: none; }
.msg-results { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.msg-results li { background: var(--surface); border-radius: 16px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.r-name { font-family: var(--font-display); font-weight: 600; font-size: 16px; }
.r-meta { font-size: 13px; color: var(--muted); }
.r-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; }
.r-acts .chip--sm { background: var(--bg); }
.r-acts .chip--sm:hover { background: var(--hover-chip); }
.assist-quick { display: flex; gap: 6px; overflow-x: auto; padding: 8px 12px; border-top: 1px solid var(--line); scrollbar-width: none; }
.assist-quick::-webkit-scrollbar { display: none; }
.assist-quick .chip--sm { flex: none; background: var(--bg); }
.assist-form { display: flex; gap: 8px; padding: 4px 12px 12px; }
.assist-form input { flex: 1; min-width: 0; min-height: 46px; padding: 0 16px; border-radius: var(--r-pill); border: 2px solid var(--line); background: var(--bg); font-size: 16px; }
.assist-form input:focus-visible { outline: none; border-color: var(--ink); }
.assist-send { flex: none; width: 46px; height: 46px; border: 0; border-radius: 50%; background: var(--strong); color: var(--on-strong); display: grid; place-items: center; }
.assist-bubble { position: fixed; z-index: 44; right: 24px; bottom: 136px; max-width: 260px; padding: 10px 14px; border-radius: 18px 18px 6px 18px; background: var(--strong); color: var(--on-strong); font-size: 14px; font-weight: 500; box-shadow: 0 8px 24px rgba(22,48,43,.22); cursor: pointer; animation: assist-in .2s ease-out; }
@media (max-width: 1024px) {
  .assist { left: 10px; right: 10px; width: auto; max-width: 520px; margin: 0 auto; bottom: calc(100px + env(safe-area-inset-bottom)); max-height: calc(100dvh - 180px - env(safe-area-inset-bottom)); transform-origin: 50% 100%; }
  .assist-bubble { left: 20px; right: 20px; margin: 0 auto; width: fit-content; bottom: calc(106px + env(safe-area-inset-bottom)); border-radius: 18px; text-align: center; }
}
@media (prefers-reduced-motion: reduce) { .assist, .assist-bubble { animation: none; } .dock-fig { transition: none; } }

/* ===== Guardar ===== */
.card-main { padding-right: 52px; }
.save { position: absolute; top: 6px; right: 6px; width: 44px; height: 44px; border: 0; border-radius: 50%; background: transparent; color: var(--muted); display: grid; place-items: center; }
.save:hover { background: var(--hover-chip); color: var(--ink); }
.save[aria-pressed="true"], .btn[data-save][aria-pressed="true"] { color: var(--ink); }
.save[aria-pressed="true"] path, .btn[data-save][aria-pressed="true"] path { fill: var(--accent); }
.save--sm, .selcard-actions .save { position: static; width: 36px; height: 36px; }
.selcard-actions .save { width: 44px; height: 44px; }
.selcard-actions, .row-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.btn[data-save] { gap: 8px; }

/* ===== Páginas: Guardados, Tu negocio, Ajustes ===== */
.page { max-width: 1040px; margin: 0 auto; padding: 20px var(--pad) 40px; display: flex; flex-direction: column; gap: 16px; }
.page h1 { margin: 0; }
.page h1:focus, .profile h1:focus, .hero h1:focus { outline: none; }
.lead { margin: 0; color: var(--muted); }
.notice { margin: 0; padding: 14px 18px; border-radius: var(--r-md); background: var(--moved-bg); color: var(--moved-fg); font-weight: 500; }
.page-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 16px; align-items: start; }
.list--page { background: var(--surface); border-radius: var(--r-lg); padding: 8px; overflow: visible; }
.list--page:empty { display: none; } /* sin guardados no se dibuja una barra vacía sobre el aviso */
.page-empty { background: var(--surface); border-radius: var(--r-lg); padding: 28px; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.page-empty p { margin: 0; }
.checklist { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.small { font-size: 14px; }
.owner-form { display: flex; flex-direction: column; gap: 12px; width: 100%; }
.owner-form label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; font-size: 14px; }
.owner-form input, .owner-form select { min-height: 44px; padding: 0 12px; border-radius: 14px; border: 2px solid var(--line); background: var(--bg); font-weight: 400; font-size: 16px; color: var(--ink); }
.owner-form input:focus-visible, .owner-form select:focus-visible { outline: none; border-color: var(--ink); }
.owner-hours { display: flex; gap: 12px; } .owner-hours label { flex: 1; min-width: 0; }
.preview-card { width: 100%; display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border-radius: 18px; background: var(--bg); border-left: 8px solid var(--cat, #F2A33A); }
.setting { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; width: 100%; }
button, input, select { font: inherit; color: inherit; }

/* Respuesta al tocar a Nubi en la barra (un solo rebote, sin bucles) */
.dock-fig.is-poked svg { animation: nb-squish .35s ease-out 1; transform-origin: 50% 100%; }
@keyframes nb-squish { 0%, 100% { transform: scale(1, 1); } 40% { transform: scale(1.06, .92); } }
@media (prefers-reduced-motion: reduce) { .dock-fig.is-poked svg { animation: none; } }

/* ===== Módulo 01: Mi ubicación ===== */
.map-geo { position: absolute; top: 80px; right: 10px; z-index: 6; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.map-locate { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border: 0; background: var(--surface); color: var(--ink); border-radius: var(--r-pill); font-weight: 600; font-size: 14px; box-shadow: 0 2px 10px rgba(22,48,43,.18); }
.map-locate:hover { background: var(--hover); }
.map-locate.is-on .i-locate { color: var(--geo); fill: var(--geo); }
.map-locate[aria-busy="true"] { cursor: progress; }
.map-locate[aria-busy="true"] .i-locate { animation: geo-pulse 1s ease-in-out infinite; }
@keyframes geo-pulse { 50% { opacity: .3; } }
.geo-msg { position: absolute; top: 128px; left: 12px; right: 12px; z-index: 7; max-width: 420px; margin: 0; padding: 10px 44px 10px 14px; background: var(--surface); color: var(--ink); border-radius: 18px; box-shadow: 0 6px 22px rgba(22,48,43,.18); font-size: 14px; line-height: 1.4; display: flex; flex-direction: column; gap: 8px; }
.geo-msg p { margin: 0; }
.geo-msg.is-error { box-shadow: 0 6px 22px rgba(22,48,43,.18), inset 4px 0 0 var(--closed); }
.geo-msg-acts { display: flex; flex-wrap: wrap; gap: 6px; }
.geo-msg-acts:empty { display: none; }
.geo-act { min-height: 36px; padding: 0 12px; border-radius: var(--r-pill); border: 2px solid var(--line); background: transparent; color: var(--ink); font-weight: 600; font-size: 13px; }
.geo-act:hover { background: var(--hover); }
.geo-msg-close { position: absolute; top: 6px; right: 6px; width: 32px; height: 32px; border: 0; border-radius: 50%; background: transparent; color: var(--muted); display: grid; place-items: center; }
.geo-msg-close:hover { background: var(--hover); color: var(--ink); }
.user-dot { width: 20px; height: 20px; border-radius: 50%; background: var(--geo); border: 3px solid #FFFFFF; box-shadow: 0 0 0 1px rgba(15,26,34,.25), 0 2px 8px rgba(15,26,34,.35); pointer-events: none; }
.user-dot--svg { position: absolute; transform: translate(-50%, -50%); z-index: 3; }
@media (prefers-reduced-motion: reduce) { .map-locate[aria-busy="true"] .i-locate { animation: none; opacity: .5; } }
/* Fase 2: seguimiento */
.map-pill { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; border: 0; border-radius: var(--r-pill); background: var(--surface); color: var(--ink); font-weight: 600; font-size: 13px; box-shadow: 0 2px 10px rgba(22,48,43,.18); }
.map-pill:hover { background: var(--hover); }
#map-track-stop { background: var(--strong); color: var(--on-strong); }
.map-locate.is-tracking .i-locate { color: var(--geo); fill: var(--geo); }
/* Fase 3: ruta a pie (dentro de la tarjeta del negocio seleccionado) */
.route-ask, .route-info { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding-top: 10px; border-top: 1px solid var(--line); }
.route-ext { display: inline-flex; align-items: center; min-height: 40px; text-decoration: none; }
.route-btn[disabled] { opacity: .7; cursor: progress; }
.route-sum { margin: 0; font-size: 16px; }
.route-note { margin: 0; font-size: 12.5px; color: var(--muted); line-height: 1.4; }
.route-note a { color: var(--ink); font-weight: 600; }/* Con ruta activa la tarjeta se compacta para no tapar la línea */
.selcard.has-route > p, .selcard.has-route > .card-meta { display: none; }
.selcard.has-route { gap: 6px; padding: 14px 16px; }
/* Entrega A: ficha minimizable durante la ruta (misma superficie, solo más pequeña) */
.selcard.is-anim { overflow: hidden; }
.selcard.has-route:not(.is-min) h3 { padding-right: 44px; }
.selcard-toggle { position: absolute; top: 8px; right: 8px; width: 44px; height: 44px; border: 0; border-radius: 50%; background: transparent; color: var(--muted); display: grid; place-items: center; }
.selcard-toggle:hover { background: var(--hover); color: var(--ink); }
.selcard.is-min { padding: 0; gap: 0; max-width: calc(100% - 76px); } /* deja libre la atribución del mapa (abajo a la derecha) */
.selcard-min { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 60px; padding: 10px 10px 10px 16px; border: 0; border-radius: inherit; background: transparent; color: var(--ink); text-align: left; font: inherit; cursor: pointer; }
.selcard-min:hover { background: var(--hover); }
.selcard-min:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.selcard-min-txt { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.selcard-min-name { font-family: var(--font-display); font-weight: 700; font-size: 17px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.selcard-min-route { display: flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--muted); }
.selcard-min-route svg { flex: none; color: var(--geo); }
.selcard-chev { flex: none; width: 36px; height: 36px; border-radius: 50%; background: var(--hover); display: grid; place-items: center; }

/* ===== M03: búsqueda y resultados ===== */
.search { padding-right: 6px; }
.search input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; display: none; }
.search-clear { flex: none; width: 40px; height: 40px; border: 0; border-radius: 50%; background: transparent; color: var(--muted); display: grid; place-items: center; }
.search-clear:hover { background: var(--hover); color: var(--ink); }
.search-clear[hidden] { display: none; }
.q-live { display: none; margin: 8px 4px 0; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; font-weight: 500; color: var(--muted); }
.q-live-go { min-height: 44px; padding: 0 14px; border: 0; border-radius: var(--r-pill); background: var(--strong); color: var(--on-strong); font-weight: 600; font-size: 14px; }
@media (max-width: 900px) { .hero.is-typing .q-live:not([hidden]) { display: flex; } }
/* Resultados que cambian: fundido corto (solo al cambiar la búsqueda o los filtros) */
@keyframes r-in { from { opacity: 0; transform: translateY(6px); } }
.r-anim > li { animation: r-in .2s ease-out both; animation-delay: calc(min(var(--i, 0), 6) * 25ms); }
/* Panel inferior sobre el mapa: solo en celular y tableta; en escritorio la lista de la izquierda es el panel */
.rsheet { display: none; }
@media (max-width: 900px) {
  .rsheet { position: absolute; left: 12px; right: 12px; bottom: 12px; z-index: 6; display: flex; flex-direction: column; background: var(--surface); border-radius: 24px; box-shadow: 0 8px 28px rgba(22,48,43,.18);
    transition: transform .2s ease, opacity .2s ease; }
  .rsheet[data-state="hidden"] { visibility: hidden; opacity: 0; transform: translateY(18px); pointer-events: none; transition: transform .18s ease, opacity .18s ease, visibility 0s linear .18s; }
  .rsheet-head { position: relative; display: flex; align-items: center; gap: 2px; padding: 6px 6px 4px 4px; }
  .rsheet-grip { position: absolute; top: 5px; left: 50%; width: 36px; height: 4px; margin-left: -18px; border-radius: 2px; background: var(--line); }
  .rsheet-title { flex: 1 1 auto; min-width: 0; min-height: 48px; display: flex; align-items: center; padding: 8px 12px; border: 0; border-radius: 18px; background: transparent; color: var(--ink); font: inherit; font-weight: 600; font-size: 15px; text-align: left; }
  .rsheet-title span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .rsheet-title:hover { background: var(--hover); }
  .rsheet-btn { flex: none; width: 44px; height: 44px; border: 0; border-radius: 50%; background: transparent; color: var(--muted); display: grid; place-items: center; }
  .rsheet-btn:hover { background: var(--hover); color: var(--ink); }
  .rsheet-btn svg { transition: transform .2s ease; }
  .rsheet[data-state="full"] #rsheet-size svg { transform: rotate(180deg); }
  .rsheet[data-state="min"] #rsheet-size { display: none; }
  .rsheet-body { max-height: 0; overflow-y: auto; overscroll-behavior: contain; transition: max-height .22s ease; }
  .rsheet[data-state="peek"] .rsheet-body { max-height: calc(var(--map-h, 480px) * .42 - 60px); }
  .rsheet[data-state="full"] .rsheet-body { max-height: calc(var(--map-h, 480px) * .78 - 60px); }
  .rlist { list-style: none; margin: 0; padding: 0 8px 8px; display: flex; flex-direction: column; gap: 2px; }
  .ritem { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 8px 10px; border: 0; border-radius: 16px; background: transparent; color: var(--ink); text-align: left; font: inherit; transition: background-color .15s; }
  .ritem:hover { background: var(--hover); }
  .ritem.is-sel { background: var(--sel-bg); }
  .ritem .card-ico { margin: 0; }
  .ritem-pic { flex: none; width: 44px; height: 44px; border-radius: 14px; object-fit: cover; }
  .ritem-txt { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
  .ritem-name { font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .ritem-meta { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .ritem-dist { flex: none; display: flex; flex-direction: column; align-items: flex-end; font-size: 13px; font-weight: 600; }
  .ritem-dist small { font-size: 12px; font-weight: 500; color: var(--muted); }
  .rsheet-empty { padding: 0 16px 14px; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
  .rsheet-empty p { margin: 0; color: var(--muted); font-size: 14px; }
  /* Un solo panel abajo: con resultados abiertos la ficha espera; recogidos, la ficha queda encima de la cabecera */
  .mapwrap.rs-open .selcard { display: none; }
  .mapwrap.rs-min .selcard { bottom: calc(var(--rs-h, 60px) + 20px); }
  .mapwrap.rs-on .maplibregl-ctrl-bottom-right { bottom: calc(var(--rs-h, 60px) + 14px); } /* la atribución sigue visible */
}
@media (prefers-reduced-motion: reduce) {
  .r-anim > li { animation: none; }
  .rsheet, .rsheet[data-state="hidden"], .rsheet-body, .rsheet-btn svg, .ritem { transition: none; }
}

/* ===== Descubrimiento y cabecera compacta (2026-11-27) =====
   - Cabecera: el tema pasó a Ajustes; el aviso de prueba queda como etiqueta corta (sigue visible y accesible).
   - Celular: título más corto, filtros en una sola fila deslizable y la lista como vista inicial. */
.pill-demo { padding: 3px 10px; font-size: 12px; font-weight: 600; letter-spacing: .01em; }
.chip--modo { display: inline-flex; align-items: center; gap: 6px; }
.chip--modo svg { flex: none; }
.tag--modo { display: inline-flex; align-items: center; gap: 4px; background: var(--hover-chip); color: var(--ink); }
.tag--modo svg { flex: none; opacity: .85; }
.invite { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin: 10px 4px 4px; padding: 14px 16px; border-radius: 18px; border: 2px dashed var(--line); }
.invite p { margin: 0; flex: 1 1 220px; font-size: 14px; color: var(--muted); } .invite strong { color: var(--ink); }
.offmap { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin: 10px var(--pad) 0; padding: 8px 8px 8px 14px; border-radius: 16px; background: var(--surface); }
.offmap[hidden] { display: none; }
.offmap p { margin: 0; flex: 1 1 200px; font-size: 14px; font-weight: 500; }
/* Patrocinado: rotulado, separado de los resultados y del mismo tamaño que una tarjeta (no los empuja ni los tapa). */
.promo { margin: 0 0 6px; padding: 12px 14px; border-radius: 18px; background: var(--sel-bg); box-shadow: inset 0 0 0 1px var(--line); }
.promo-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 10px; }
.promo-lbl { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.promo-why summary { cursor: pointer; font-size: 13px; color: var(--muted); text-decoration: underline; min-height: 32px; display: inline-flex; align-items: center; }
.promo-why p { margin: 4px 0 6px; font-size: 13px; color: var(--muted); }
.promo-main { display: flex; flex-direction: column; gap: 2px; margin-top: 4px; color: var(--ink); text-decoration: none; }
.promo-name { font-family: var(--font-display); font-weight: 600; font-size: 17px; } .promo-title { font-weight: 600; font-size: 14px; } .promo-text { font-size: 14px; color: var(--muted); }
@media (max-width: 900px) {
  .topbar { flex-wrap: nowrap; padding-top: 10px; padding-bottom: 10px; }
}
@media (max-width: 640px) {
  .hero { padding-top: 14px; }
  .hero h1 { font-size: 24px; margin-bottom: 12px; }
  /* Una sola fila de filtros que se desliza: menos altura y todas las opciones a mano */
  .chips { flex-wrap: nowrap; overflow-x: auto; margin: 12px calc(-1 * var(--pad)) 0; padding: 0 var(--pad) 4px; scrollbar-width: none; scroll-padding: 0 var(--pad); }
  .chips::-webkit-scrollbar { display: none; }
  .chip { flex: none; }
}
