/* =========================================================
   Temas (día / noche) — colores base de la interfaz
   ========================================================= */
:root {
  --bg: #ffffff;
  --bg-2: #f1f1f3;
  --fg: #1d1d1f;
  --muted: #6b6b70;
  --line: #e3e3e6;
  --shadow: 0 8px 28px rgba(0, 0, 0, 0.16);
  --radius: 14px;
  --letra-sistema: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  /* Tipografía del proyecto (se carga de Google Fonts en index.html) */
  --letra-titulo: "Playfair Display", Georgia, serif;
  --letra-texto: "Mulish", var(--letra-sistema);
  font-family: var(--letra-texto);
  color: var(--fg);
  color-scheme: light;
}

/* Noche: azul medio, a juego con el mapa nocturno */
:root[data-theme="dark"] {
  --bg: #26324f;
  --bg-2: #314065;
  --fg: #eef2fb;
  --muted: #aab5d1;
  --line: #43537c;
  --shadow: 0 8px 28px rgba(8, 14, 32, 0.45);
  color-scheme: dark;
}

/* =========================================================
   Paletas de acento: unas para el modo día y otras para el modo noche
   --accent: pines y detalles · --accent-strong: texto sobre tinte (legible)
   --accent-soft: tinte suave de fondo · --accent-alt: pin seleccionado
   ========================================================= */
/* Día: colores intensos que no se confunden con el mapa
   (fondo crema, calles amarillas, parques verdes y agua azul claro) */
:root[data-palette="carmin"] {
  --accent: #d7263d; --accent-strong: #a4152a; --accent-soft: #fde8eb; --accent-alt: #2b2d42;
}
:root[data-palette="rosa"] {
  --accent: #e4007c; --accent-strong: #b0005f; --accent-soft: #fde4f1; --accent-alt: #3a0ca3;
}
/* Uva es la de inicio en el modo día */
:root,
:root[data-palette="uva"] {
  --accent: #7b2cbf; --accent-strong: #5a1d91; --accent-soft: #f1e7fb; --accent-alt: #d7263d;
}
:root[data-palette="indigo"] {
  --accent: #3a0ca3; --accent-strong: #2d0a80; --accent-soft: #ebe6fa; --accent-alt: #e4007c;
}
:root[data-palette="obsidiana"] {
  --accent: #2b2d42; --accent-strong: #2b2d42; --accent-soft: #e9e9ef; --accent-alt: #d7263d;
}

/* Noche: colores cálidos y neón que brillan sobre el mapa azul
   (sin azules, verdes, grises ni turquesas, que se perderían con calles y parques) */
:root[data-theme="dark"][data-palette="mango"] {
  --accent: #ffc533; --accent-strong: #ffe08a; --accent-alt: #ff5d73;
}
:root[data-theme="dark"][data-palette="coral"] {
  --accent: #ff5d73; --accent-strong: #ffb3bf; --accent-alt: #ffc533;
}
/* Magenta es la de inicio en el modo noche */
:root[data-theme="dark"],
:root[data-theme="dark"][data-palette="magenta"] {
  --accent: #ff4fd8; --accent-strong: #ffb0ee; --accent-alt: #ffc533;
}
:root[data-theme="dark"][data-palette="lavanda"] {
  --accent: #c792ff; --accent-strong: #e2c6ff; --accent-alt: #ffc533;
}
:root[data-theme="dark"][data-palette="naranja"] {
  --accent: #ff8c42; --accent-strong: #ffc49e; --accent-alt: #ff4fd8;
}

/* En noche, el tinte suave se mezcla con el azul de la interfaz */
:root[data-theme="dark"],
:root[data-theme="dark"][data-palette] {
  --accent-soft: color-mix(in srgb, var(--accent) 22%, var(--bg));
}

/* =========================================================
   Base
   ========================================================= */
* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  overflow: hidden;
}

#mapa {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: var(--bg-2);
}

button { font: inherit; }

/* ---------- Barra superior ---------- */
.topbar {
  position: fixed;
  top: max(12px, env(safe-area-inset-top));
  left: max(16px, env(safe-area-inset-left));
  right: max(16px, env(safe-area-inset-right));
  z-index: 1000;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  pointer-events: none; /* deja usar el mapa entre la tarjeta y los botones */
}
.topbar > * { pointer-events: auto; }
.izquierda {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
  pointer-events: none;
}
.izquierda > * { pointer-events: auto; }

.marca {
  background: var(--bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 10px 14px;
  min-width: 0;
}
.marca h1 { margin: 0; font-size: 1rem; line-height: 1.2; color: var(--fg); }
.marca h1 span { color: var(--accent-strong); }
.estado { margin: 2px 0 0; font-size: 0.8rem; color: var(--muted); }

.acciones { display: flex; gap: 8px; position: relative; }

.boton-icono {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: var(--bg);
  color: var(--fg);
  box-shadow: var(--shadow);
  display: grid;
  place-items: center;
  padding: 0;
  cursor: pointer;
}
.boton-icono:hover { color: var(--accent); }
.boton-icono:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.boton-icono svg { width: 22px; height: 22px; }
.boton-icono.chico { width: 38px; height: 38px; }
.boton-icono.chico svg { width: 19px; height: 19px; }

/* Botón de cuenta: silueta sin sesión, inicial con sesión */
.boton-cuenta .inicial {
  width: 100%; height: 100%; /* llena el botón: sin aro desfasado */
  border-radius: inherit;
  line-height: 1;
  display: grid; place-items: center;
  background: var(--accent);
  color: var(--bg);
  font-weight: 700;
  font-size: 1rem;
}
.boton-cuenta .inicial[hidden] { display: none; }

/* Muestra el icono correcto según el tema actual */
:root:not([data-theme="dark"]) .icono-sol { display: none; }
:root[data-theme="dark"] .icono-luna { display: none; }

/* ---------- Menú de personalización (colores y pines) ---------- */
.paletas {
  position: absolute;
  top: 46px;
  left: 0;
  width: 250px;
  z-index: 1;
  max-height: calc(100vh - 160px);
  overflow-y: auto;
  margin: 0;
  padding: 8px;
  list-style: none;
  background: var(--bg);
  color: var(--fg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.paletas .titulo { padding: 4px 8px 8px; font-size: 0.75rem; color: var(--muted); }
.paletas button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border: 0;
  border-radius: 10px;
  background: none;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.paletas button:hover { background: var(--bg-2); }
.paletas button[aria-checked="true"] { background: var(--accent-soft); font-weight: 600; }
.muestras { display: flex; flex-shrink: 0; }
.muestras i {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--bg);
  margin-left: -5px;
}
.muestras i:first-child { margin-left: 0; }
.paletas .titulo.separado { margin-top: 6px; padding-top: 10px; border-top: 1px solid var(--line); }
.ejemplo-pines { display: flex; gap: 2px; flex-shrink: 0; width: 76px; color: var(--accent-strong); }
.ejemplo-pines svg {
  width: 16px; height: 16px;
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
/* Ancho según su contenido (5 pines) para que nunca se encime con el nombre */
.ejemplo-pines { width: auto; min-width: 120px; align-items: flex-end; gap: 1px; }
.ejemplo-pines img { display: block; filter: drop-shadow(0 1px 1.5px rgba(0, 0, 0, 0.3)); }
.paletas .leyenda {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 8px;
  padding: 8px 8px 4px;
  font-size: 0.75rem;
  color: var(--muted);
}
.paletas .leyenda span { display: flex; align-items: center; gap: 6px; }
.paletas .leyenda svg {
  width: 16px; height: 16px; flex-shrink: 0; color: var(--accent-strong);
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}

/* ---------- Botones de la derecha: cuenta y "+" ---------- */
.derecha { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.boton-agregar { width: 40px; height: 40px; background: var(--accent); color: #fff; }
:root[data-theme="dark"] .boton-agregar { color: var(--bg); }
.boton-agregar:hover { color: #fff; filter: brightness(1.1); }
:root[data-theme="dark"] .boton-agregar:hover { color: var(--bg); }
.boton-agregar[aria-expanded="true"] svg { transform: rotate(45deg); } /* el + se vuelve × */
.boton-agregar svg { transition: transform 0.2s; }
.boton-agregar[hidden] { display: none; }

/* ---------- Panel lateral: sugerir un lugar ---------- */
.panel-lateral {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 1100;
  width: min(380px, 100vw);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom) env(safe-area-inset-left);
  background: var(--bg);
  color: var(--fg);
  box-shadow: 8px 0 40px rgba(0, 0, 0, 0.25);
  transform: translateX(-105%);
  transition: transform 0.25s ease;
}
.panel-lateral.abierto { transform: none; }
.panel-cabecera {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px 10px 12px;
  background: var(--bg);
}
.panel-cabecera h2 { order: 2; margin: 0; font-size: 1.15rem; }
.cerrar-panel {
  order: 1;
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border: 0; border-radius: 50%;
  background: var(--bg-2); color: var(--fg);
  cursor: pointer;
}
.cerrar-panel svg { width: 20px; height: 20px; }
.cerrar-panel:hover { background: var(--line); }
.panel-cuerpo { padding: 0 20px 20px; }
.panel-cuerpo .sub { margin: 0 0 16px; color: var(--muted); font-size: 0.88rem; }
.panel-cuerpo label, .panel-cuerpo legend { display: block; margin-bottom: 14px; font-size: 0.85rem; font-weight: 600; }
.panel-cuerpo legend { margin-bottom: 8px; padding: 0; }
.panel-cuerpo fieldset { margin: 0 0 14px; padding: 0; border: 0; }
.panel-cuerpo .req { color: var(--accent-strong); }
.panel-cuerpo input:not([type="radio"]), .panel-cuerpo textarea {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-2);
  color: var(--fg);
  font: inherit;
  font-size: 16px; /* evita zoom en iOS */
  font-weight: 400;
  resize: vertical;
}
.panel-cuerpo input::placeholder, .panel-cuerpo textarea::placeholder { color: var(--muted); opacity: 0.8; }
.panel-cuerpo input:focus, .panel-cuerpo textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
.panel-cuerpo .error {
  margin: 0 0 12px; padding: 8px 10px; border-radius: 8px;
  background: color-mix(in srgb, #e5484d 14%, var(--bg));
  color: color-mix(in srgb, #e5484d 75%, var(--fg));
  font-size: 0.85rem;
}
.opciones-categoria { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.opcion-categoria {
  position: relative;
  display: flex !important;
  align-items: center;
  gap: 8px;
  margin: 0 !important;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg-2);
  font-weight: 500 !important;
  cursor: pointer;
}
.opcion-categoria input { position: absolute; opacity: 0; pointer-events: none; }
.opcion-categoria svg {
  width: 19px; height: 19px; flex-shrink: 0; color: var(--accent-strong);
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.opcion-categoria:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-weight: 700 !important;
}
.opcion-categoria:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 1px; }
.texto-ubicacion { margin: 0 0 8px; font-size: 0.85rem; color: var(--muted); }
.texto-ubicacion strong { display: block; color: #16a34a; }
:root[data-theme="dark"] .texto-ubicacion strong { color: #4ade80; }
.texto-ubicacion small { font-size: 0.75rem; }
.texto-ubicacion.mal { color: color-mix(in srgb, #e5484d 80%, var(--fg)); }
.botones-ubicacion { display: flex; gap: 8px; }
.botones-ubicacion .boton-secundario { width: auto; flex: 1; padding: 10px; font-size: 0.88rem; }
.botones-ubicacion [hidden] { display: none; }
.panel-gracias { text-align: center; padding-top: 24px; }
.icono-gracias {
  width: 64px; height: 64px; margin: 0 auto 12px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: color-mix(in srgb, #16a34a 16%, var(--bg));
  color: #16a34a;
  font-size: 2rem; font-weight: 700;
}
.panel-gracias h3 { margin: 0 0 6px; }
.mis-solicitudes { margin: 4px 20px 24px; padding-top: 16px; border-top: 1px solid var(--line); }
.mis-solicitudes h3 { margin: 0 0 10px; font-size: 0.9rem; }
.mis-solicitudes ul { margin: 0; padding: 0; list-style: none; }
.mis-solicitudes li {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding: 8px 0; font-size: 0.85rem;
}
.mis-solicitudes li > span:first-child { display: flex; align-items: center; gap: 8px; min-width: 0; }
.mis-solicitudes li svg {
  width: 16px; height: 16px; flex-shrink: 0; color: var(--accent-strong);
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.mis-solicitudes .estado { flex-shrink: 0; padding: 2px 8px; border-radius: 999px; font-size: 0.72rem; font-weight: 600; background: var(--bg-2); color: var(--muted); }
.mis-solicitudes .estado-aprobada { background: color-mix(in srgb, #16a34a 16%, var(--bg)); color: #16a34a; }
.mis-solicitudes .estado-rechazada { background: color-mix(in srgb, #e5484d 14%, var(--bg)); color: #e5484d; }

/* ---------- Etiquetas (chips) ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.3;
}
button.chip { cursor: pointer; }
button.chip:hover { border-color: color-mix(in srgb, var(--accent) 50%, transparent); }
.chip svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.popup .chips-ficha { margin: 6px 0 4px; }

/* Campo de etiquetas del formulario: chips + texto en la misma caja */
.grupo-etiquetas { margin-bottom: 14px; }
.grupo-etiquetas > label { margin-bottom: 2px !important; }
.grupo-etiquetas .ayuda { margin: 0 0 6px; color: var(--muted); font-size: 0.76rem; font-weight: 400; }
.campo-etiquetas {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-2);
  cursor: text;
}
.campo-etiquetas:focus-within { outline: 2px solid var(--accent); border-color: transparent; }
.campo-etiquetas .chips { display: contents; }
.campo-etiquetas li {
  display: inline-flex; align-items: center; gap: 2px;
  padding: 3px 4px 3px 10px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 0.82rem; font-weight: 600;
}
:root[data-theme="dark"] .campo-etiquetas li { color: var(--bg); }
.campo-etiquetas li button {
  width: 22px; height: 22px;
  display: grid; place-items: center;
  border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, 0.25); color: inherit;
  font-size: 15px; line-height: 1; cursor: pointer;
}
.panel-cuerpo .campo-etiquetas input {
  flex: 1;
  min-width: 110px;
  width: auto !important;
  margin: 0 !important;
  padding: 4px 4px !important;
  border: 0 !important;
  background: none !important;
  outline: none !important;
}
.sugerencias-etiquetas { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip-sugerida { background: var(--bg-2); color: var(--fg); border-color: var(--line); font-weight: 500; }

/* ---------- Botón y panel de administración ---------- */
.boton-admin { position: relative; }
.boton-admin[hidden] { display: none; }
.boton-filtros { position: relative; }
.boton-filtros.activo { color: var(--accent); }
.boton-admin .contador, .boton-filtros .contador {
  position: absolute; top: -4px; right: -4px;
  min-width: 18px; height: 18px; padding: 0 5px;
  display: grid; place-items: center;
  border-radius: 999px;
  background: #e5484d; color: #fff;
  font-size: 0.68rem; font-weight: 700;
  box-shadow: 0 0 0 2px var(--bg);
}
.boton-admin .contador[hidden], .boton-filtros .contador[hidden] { display: none; }
.boton-filtros .contador { background: var(--accent); color: var(--bg); }
.segmentos {
  display: flex; gap: 4px; margin-bottom: 14px; padding: 4px;
  border-radius: 12px; background: var(--bg-2);
}
.segmentos button {
  flex: 1 1 auto; min-width: 0; padding: 8px 4px; border: 0; border-radius: 9px; font-size: 0.82rem;
  background: none; color: var(--muted); font-weight: 600; cursor: pointer;
}
.segmentos button[aria-selected="true"] { background: var(--bg); color: var(--fg); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12); }
.lista-admin { display: grid; gap: 12px; }
.vacio-admin { margin: 24px 0; text-align: center; color: var(--muted); }
.tarjeta-solicitud {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg);
}
.tarjeta-solicitud header { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.tarjeta-solicitud h3 { margin: 0; font-size: 1rem; }
.tarjeta-solicitud .chip-categoria { flex-shrink: 0; }
.tarjeta-solicitud .meta { margin: 4px 0 10px; color: var(--muted); font-size: 0.78rem; }
.tarjeta-solicitud .chips { margin-bottom: 10px; }
.tarjeta-solicitud dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; margin: 0 0 12px; font-size: 0.82rem; }
.tarjeta-solicitud dt { color: var(--muted); }
.tarjeta-solicitud dd { margin: 0; overflow-wrap: anywhere; }
.acciones-solicitud { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.acciones-solicitud > * { width: auto; flex: 1; padding: 9px 10px; font-size: 0.85rem; }
.acciones-solicitud .ver { flex-basis: 100%; }
.acciones-solicitud .rechazar { color: color-mix(in srgb, #e5484d 80%, var(--fg)); }
.acciones-solicitud .estado {
  flex: 0 0 auto; padding: 4px 10px; border-radius: 999px; font-size: 0.75rem; font-weight: 700;
  background: var(--bg-2); color: var(--muted);
}
.acciones-solicitud .estado-aprobada { background: color-mix(in srgb, #16a34a 16%, var(--bg)); color: #16a34a; }
.acciones-solicitud .estado-rechazada { background: color-mix(in srgb, #e5484d 14%, var(--bg)); color: #e5484d; }
.revisando .buscador { display: none; }

/* ---------- Marcar la ubicación en el mapa ---------- */
/* Pin fijo al centro de la pantalla: se mueve el mapa debajo de él. */
.mira {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 900;
  width: 34px;
  height: 44px;
  translate: -50% -100%; /* la punta queda justo en el centro */
  pointer-events: none;
  background: no-repeat center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 40'%3E%3Cpath d='M16 38.5S3.5 25.6 3.5 15.8a12.5 12.5 0 0 1 25 0C28.5 25.6 16 38.5 16 38.5Z' fill='%2316a34a' stroke='%23fff' stroke-width='2.5'/%3E%3Cpath d='M16 9v13M9.5 15.5h13' stroke='%23fff' stroke-width='2.6' stroke-linecap='round'/%3E%3C/svg%3E");
  filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.35));
}
.mira::after { /* sombrita en el punto exacto */
  content: "";
  position: absolute;
  left: 50%;
  bottom: -3px;
  width: 8px;
  height: 4px;
  translate: -50% 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.35);
}
.marca-nueva {
  width: 34px;
  height: 44px;
  background: no-repeat center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 40'%3E%3Cpath d='M16 38.5S3.5 25.6 3.5 15.8a12.5 12.5 0 0 1 25 0C28.5 25.6 16 38.5 16 38.5Z' fill='%2316a34a' stroke='%23fff' stroke-width='2.5'/%3E%3Cpath d='M16 9v13M9.5 15.5h13' stroke='%23fff' stroke-width='2.6' stroke-linecap='round'/%3E%3C/svg%3E");
  filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.35));
}
.barra-ubicacion {
  position: fixed;
  left: 50%;
  bottom: calc(max(16px, env(safe-area-inset-bottom)) + var(--teclado, 0px));
  z-index: 1000;
  width: min(480px, calc(100% - 32px));
  translate: -50% 0;
  padding: 14px;
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--fg);
  box-shadow: var(--shadow);
}
.barra-ubicacion p { margin: 0 0 10px; font-size: 0.88rem; text-align: center; }
.barra-ubicacion .botones { display: flex; gap: 8px; }
.barra-ubicacion .botones > * { flex: 1; width: auto; }
/* Mientras se marca la ubicación, se ocultan el buscador y las píldoras */
.eligiendo-ubicacion .buscador { display: none; }

/* ---------- Modal de inicio de sesión ---------- */
.modal {
  width: min(360px, calc(100% - 32px));
  padding: 28px 24px 24px;
  border: 0;
  border-radius: 20px;
  background: var(--bg);
  color: var(--fg);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}
.modal::backdrop { background: rgba(10, 16, 32, 0.5); } /* sin blur: falla sobre el mapa WebGL */
.modal[open] { animation: aparecer 0.18s ease-out; }
@keyframes aparecer { from { opacity: 0; transform: translateY(8px) scale(0.98); } }
.modal h2 { margin: 0 0 4px; font-size: 1.25rem; }
.modal .sub { margin: 0 0 18px; color: var(--muted); font-size: 0.88rem; }
.modal label { display: block; margin-bottom: 12px; font-size: 0.85rem; font-weight: 600; }
.modal input {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-2);
  color: var(--fg);
  font: inherit;
  font-size: 16px; /* evita zoom en iOS */
}
.modal input:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
.con-ojo { position: relative; display: block; }
.con-ojo input { padding-right: 44px; }
.ojo {
  position: absolute; right: 4px; top: 50%; translate: 0 calc(-50% + 3px);
  width: 36px; height: 36px;
  border: 0; background: none; color: var(--muted); cursor: pointer;
  display: grid; place-items: center; border-radius: 8px;
}
.ojo[aria-pressed="true"] { color: var(--accent-strong); }
.ojo svg { width: 20px; height: 20px; }
.modal .error {
  margin: 0 0 12px;
  padding: 8px 10px;
  border-radius: 8px;
  background: color-mix(in srgb, #e5484d 14%, var(--bg));
  color: color-mix(in srgb, #e5484d 75%, var(--fg));
  font-size: 0.85rem;
}
.boton-principal, .boton-secundario {
  width: 100%;
  padding: 12px;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
}
.boton-principal { border: 0; background: var(--accent); color: var(--bg); }
:root:not([data-theme="dark"]) .boton-principal { color: #fff; }
.boton-principal:disabled { opacity: 0.6; cursor: progress; }
.boton-secundario {
  border: 1px solid var(--line);
  background: var(--bg-2);
  color: var(--fg);
}
.boton-secundario:hover { background: var(--line); }
.cerrar-modal {
  position: absolute; top: 12px; right: 12px;
  width: 32px; height: 32px;
  border: 0; border-radius: 50%;
  background: var(--bg-2); color: var(--muted);
  font-size: 22px; line-height: 1; cursor: pointer;
}
.cerrar-modal:hover { background: var(--line); color: var(--fg); }

/* ---------- Buscador inferior ---------- */
.buscador {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(max(16px, env(safe-area-inset-bottom)) + var(--teclado, 0px));
  width: min(640px, calc(100% - 32px - env(safe-area-inset-left) - env(safe-area-inset-right)));
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.campo {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg);
  border-radius: 999px;
  box-shadow: var(--shadow);
  padding: 0 8px 0 16px;
  color: var(--muted);
}
.campo:focus-within { outline: 2px solid var(--accent); }

#busqueda {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--fg);
  font: inherit;
  font-size: 16px; /* evita zoom automático en iOS */
  padding: 14px 0;
  outline: none;
}
#busqueda::placeholder { color: var(--muted); }
#busqueda::-webkit-search-cancel-button { display: none; }

.limpiar {
  border: 0;
  background: var(--line);
  color: var(--fg);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.resultados {
  list-style: none;
  margin: 0;
  padding: 6px;
  background: var(--bg);
  color: var(--fg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  /* Lo que quede visible (con o sin teclado) menos el buscador y un respiro arriba */
  max-height: min(360px, calc(var(--alto-visible, 100dvh) - 200px));
  overscroll-behavior: contain;
  overflow-y: auto;
}
.resultados li {
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
}
.resultados li:hover,
.resultados li[aria-selected="true"] { background: var(--accent-soft); }
.resultados .nombre { font-weight: 600; }
.resultados .detalle { font-size: 0.82rem; color: var(--muted); margin-top: 2px; }
.resultados mark { background: none; color: var(--accent-strong); font-weight: 700; }
.resultados .vacio { color: var(--muted); cursor: default; }
.resultados .vacio:hover { background: none; }

/* ---------- Marcadores ---------- */
/* Los pines los dibuja MapLibre (capa de símbolos): ver pintarPines() en app.js */

/* ---------- Ficha del restaurante: tarjeta flotante (celular); el panel de escritorio está al final ---------- */
.maplibregl-map { font: inherit; }
.tarjeta-ficha .maplibregl-popup-content {
  width: min(280px, calc(100vw - 48px));
  padding: 12px 12px 14px;
  border-radius: 16px;
  overflow: hidden; /* la foto llega hasta las orillas de arriba */
  touch-action: pan-x; /* el deslizar vertical lo usamos para cerrar */
  background: var(--bg);
  color: var(--fg);
  box-shadow: var(--shadow);
  font-size: 0.9rem;
  line-height: 1.4;
}
.tarjeta-ficha.maplibregl-popup-anchor-bottom .maplibregl-popup-tip { border-top-color: var(--bg); }
.popup h2 { margin: 0 0 4px; font-size: 1rem; }
.popup p { margin: 2px 0; color: var(--muted); }
/* Estrellas: dorado en cualquier paleta y tema */
:root { --estrella: #f2b01e; }

/* Verde de "visitado" (contorno del pin, leyenda y resultados).
   Cada diseño usa un verde de su familia, siempre con buen contraste sobre su mapa. */
:root { --visitado: #16a34a; }
:root[data-theme="dark"] { --visitado: #4ade80; }
:root[data-diseno="sobrio"] { --visitado: #3f8f4f; }            /* verde olivo sobre el mapa crema */
:root[data-diseno="sobrio"][data-theme="dark"] { --visitado: #8fdc8a; } /* verde salvia luminoso sobre gris carbón */
:root[data-diseno="minimal"][data-theme="dark"] { --visitado: #5ee08a; }
.popup .calificacion { margin-top: 8px; }
.popup .fila-prom { display: flex; align-items: center; gap: 8px; font-size: 0.82rem; color: var(--muted); }
.popup .fila-prom strong { color: var(--fg); }
.estrellas-prom { position: relative; display: inline-block; font-size: 1.05rem; line-height: 1; letter-spacing: 1px; white-space: nowrap; }
.estrellas-prom .vacias { color: var(--line); }
.estrellas-prom .llenas { position: absolute; inset: 0 auto 0 0; width: var(--valor); overflow: hidden; color: var(--estrella); }
.popup .fila-mia {
  display: flex;
  flex-direction: column; /* etiqueta arriba, estrellas abajo: caben grandes aun en celular */
  align-items: center;
  gap: 2px;
  margin-top: 8px;
  padding: 6px 8px 4px;
  border-radius: 12px;
  background: var(--bg-2);
}
.popup .fila-mia .etiqueta { font-size: 0.78rem; font-weight: 600; color: var(--muted); }
.mias { display: flex; gap: 2px; }
.mias button {
  border: 0;
  background: none;
  padding: 2px 5px;
  font-size: 1.6rem;
  line-height: 1;
  color: var(--line);
  cursor: pointer;
  transition: transform 0.1s, color 0.1s;
}
.mias button.llena { color: var(--estrella); }
.mias.con-previa button { color: var(--line); }
.mias.con-previa button.previa { color: var(--estrella); }
.mias button:active { transform: scale(1.2); }
.mias button:focus-visible { outline: 2px solid var(--accent); border-radius: 6px; }
.popup .calificar-login {
  display: block;
  margin-top: 6px;
  text-align: left;
  line-height: 1.35;
  padding: 2px 0;
  border: 0;
  background: none;
  color: var(--accent-strong);
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}
.resultados .prom-lista { color: var(--fg); font-weight: 600; }
.resultados .prom-lista i { font-style: normal; color: var(--estrella); }

.popup .foto {
  position: relative;
  height: 150px;
  margin: -12px -12px 10px; /* a sangre: de orilla a orilla, pegada arriba */
  border-radius: 0;
  overflow: hidden;
  background: var(--bg-2);
}
.popup .foto img { width: 100%; height: 100%; object-fit: cover; display: block; }
.popup .foto.cargando {
  background: linear-gradient(90deg, var(--bg-2) 25%, var(--line) 50%, var(--bg-2) 75%);
  background-size: 200% 100%;
  animation: brillo 1.2s infinite linear;
}
@keyframes brillo { to { background-position: -200% 0; } }
.popup .foto.sin-foto {
  height: 48px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 0.8rem;
}
.popup .credito {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 14px 8px 4px;
  font-size: 0.7rem;
  color: #fff;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.6));
}
.popup .credito a { color: #fff; }

.popup .botones-ficha { display: flex; gap: 8px; margin-top: 10px; }
.popup .botones-ficha .como-llegar { flex: 1; min-width: 0; } /* ocupa todo lo que deja la casilla */
.popup .boton-visita {
  flex: none;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--bg-2);
  color: var(--fg);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.popup .boton-visita svg {
  width: 24px; height: 24px; flex-shrink: 0;
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.popup .boton-visita .check { opacity: 0; }
.popup .boton-visita:hover .check { opacity: 0.35; }
.popup .boton-visita[aria-pressed="true"] {
  background: color-mix(in srgb, #16a34a 14%, var(--bg));
  border-color: color-mix(in srgb, #16a34a 55%, transparent);
  color: color-mix(in srgb, #16a34a 70%, var(--fg));
}
.popup .boton-visita[aria-pressed="true"] rect { fill: #16a34a; stroke: #16a34a; }
.popup .boton-visita[aria-pressed="true"] .check { opacity: 1; stroke: #fff; }
.popup .boton-visita[hidden] { display: none; }
.popup .boton-visita:active { transform: scale(0.92); }
.popup .boton-visita.fallo { border-color: #e5484d; animation: sacudir 0.35s; }
@keyframes sacudir { 25% { translate: -3px 0; } 75% { translate: 3px 0; } }

.insignia-visitado { width: 14px; height: 14px; flex-shrink: 0; vertical-align: -2px; }
.resultados .ya-visitado { display: inline-flex; align-items: center; gap: 3px; color: var(--visitado); font-weight: 600; }
.paletas .leyenda .insignia-visitado { width: 15px; height: 15px; }

.popup .como-llegar {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  margin-top: 0;
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  background: var(--accent-soft);
  color: var(--accent-strong) !important;
  text-align: center;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s;
}
.popup .como-llegar:hover { background: color-mix(in srgb, var(--accent) 30%, var(--bg)); }

/* ---------- Píldoras de categorías ---------- */
.categorias {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 2px; /* deja ver la sombra y el contorno de foco */
  margin: -2px;
}
.categorias::-webkit-scrollbar { display: none; }
/* Centradas cuando caben; si no caben, se deslizan desde la primera */
.categorias .pildora:first-child { margin-left: auto; }
.categorias .pildora:last-child { margin-right: auto; }
.categorias.mas-derecha {
  -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 40px), transparent);
  mask-image: linear-gradient(to right, #000 calc(100% - 40px), transparent);
}
.pildora {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px 6px 9px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--bg);
  color: var(--fg);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.14);
  font-size: 0.82rem;
  cursor: pointer;
  white-space: nowrap;
}
.pildora svg {
  width: 16px; height: 16px; color: var(--accent-strong);
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.pildora small { font-size: 0.72rem; color: var(--muted); }
.pildora:hover { background: var(--bg-2); }
.pildora:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.pildora[aria-pressed="true"] {
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  color: var(--accent-strong);
  font-weight: 600;
}
.pildora[aria-pressed="true"] small { color: inherit; }

/* ---------- Controles del mapa ---------- */
/* Por encima del buscador y las píldoras */
.maplibregl-ctrl-bottom-left,
.maplibregl-ctrl-bottom-right { bottom: calc(max(16px, env(safe-area-inset-bottom)) + 104px); }
.maplibregl-ctrl-bottom-right .maplibregl-ctrl { margin: 0 16px 0 0; }
.maplibregl-ctrl-group {
  background: var(--bg);
  border-radius: 10px;
  box-shadow: var(--shadow);
}
.maplibregl-ctrl-group button + button { border-top-color: var(--line); }
:root[data-theme="dark"] .maplibregl-ctrl-group .maplibregl-ctrl-icon { filter: invert(1); }

/* Créditos casi invisibles: siguen ahí (lo pide la licencia) pero no estorban */
.maplibregl-ctrl-bottom-left .maplibregl-ctrl-attrib {
  margin: 0 0 0 8px;
  padding: 0 4px;
  background: none;
  font-size: 9px;
  line-height: 1.4;
  color: var(--muted);
  opacity: 0.45;
  transition: opacity 0.2s;
}
.maplibregl-ctrl-attrib:hover { opacity: 1; }
.maplibregl-ctrl-attrib a { color: inherit; }

/* =========================================================
   Celulares y pantallas táctiles
   ========================================================= */
html, body { overscroll-behavior: none; }
button, a, .resultados li { -webkit-tap-highlight-color: transparent; }
button { touch-action: manipulation; } /* sin espera por doble toque */

@media (pointer: coarse) {
  /* En touch se hace zoom con dos dedos: los botones +/− sobran */
  .maplibregl-ctrl-bottom-right .maplibregl-ctrl-group { display: none; }
  /* Objetivos de toque más cómodos (≈ 40–44 px) */
  .pildora { padding: 9px 13px 9px 11px; }
  .limpiar { width: 36px; height: 36px; }
  .mias button { font-size: 1.8rem; padding: 2px 5px; }
  .paletas button { padding: 11px 8px; }
  .resultados li { padding: 12px; }
}

@media (max-width: 480px) {
  .marca { padding: 8px 12px; }
  .marca h1 { font-size: 0.95rem; }
  .estado { font-size: 0.75rem; }
  .buscador { gap: 6px; }
  #busqueda { padding: 13px 0; }
  .maplibregl-ctrl-bottom-left,
  .maplibregl-ctrl-bottom-right { bottom: calc(max(16px, env(safe-area-inset-bottom)) + 112px); }
  /* El menú de colores ocupa casi todo el ancho y se desplaza si no cabe */
  .paletas { width: min(280px, calc(100vw - 32px)); max-height: calc(var(--alto-visible, 100dvh) - 140px); }
  /* El inicio de sesión sube como hoja desde abajo, más fácil de alcanzar con el pulgar */
  .modal {
    width: 100%;
    max-width: 100%;
    margin: auto 0 var(--teclado, 0px); /* sube junto con el teclado */
    max-height: calc(var(--alto-visible, 100dvh) - 24px);
    padding: 26px 20px calc(20px + env(safe-area-inset-bottom));
    border-radius: 22px 22px 0 0;
  }
  .modal[open] { animation: subir 0.22s ease-out; }
  @keyframes subir { from { transform: translateY(40px); opacity: 0; } }
}

@media (max-width: 360px) {
  .marca h1 { font-size: 0.88rem; }
  .boton-icono { width: 40px; height: 40px; }
  .pildora { font-size: 0.78rem; }
}

/* Celular acostado: poco alto, todo más compacto */
@media (max-height: 480px) and (orientation: landscape) {
  .estado { display: none; }
  .izquierda { flex-direction: row; align-items: center; }
  .resultados { max-height: calc(var(--alto-visible, 100dvh) - 150px); }
  .popup .foto { height: 100px; }
}

/* ---------- Foto en el formulario (cámara, galería o computadora) ---------- */
.vista-foto {
  position: relative;
  display: grid;
  place-items: center;
  height: 150px;
  margin-bottom: 8px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg-2);
  border: 1px dashed var(--line);
  color: var(--muted);
  font-size: 0.82rem;
  text-align: center;
}
.vista-foto img { width: 100%; height: 100%; object-fit: cover; display: block; }
.vista-foto img[hidden] { display: none; }
.vista-foto.vacia { height: 96px; }
.vista-foto:not(.vacia) { border-style: solid; }
.vista-foto:not(.vacia) .texto-foto { display: none; }
.vista-foto .texto-foto { padding: 0 16px; }
.vista-foto.procesando::after {
  content: "Preparando foto…";
  position: absolute; inset: 0;
  display: grid; place-items: center;
  background: color-mix(in srgb, var(--bg) 75%, transparent);
  color: var(--fg); font-weight: 600;
}
.botones-foto { display: flex; gap: 8px; }
.botones-foto .boton-secundario {
  width: auto; flex: 1;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px; font-size: 0.88rem;
}
.botones-foto .quitar-foto { flex: 0 0 auto; padding: 10px 14px; }
.botones-foto [hidden] { display: none; }
.botones-foto .boton-archivo { position: relative; margin: 0; }
.boton-archivo svg { width: 18px; height: 18px; flex-shrink: 0; }
.boton-archivo:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
/* El input real queda invisible encima del botón: así el clic abre el selector nativo */
.boton-archivo input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
/* "Tomar foto" solo en pantallas táctiles (en la computadora "capture" no abre la cámara) */
.solo-tactil { display: none !important; }
@media (pointer: coarse) {
  .solo-tactil { display: inline-flex !important; }
  span.solo-tactil { display: inline !important; }
  .solo-raton { display: none; }
}
.panel-lateral.editando .campo-notas,
.panel-lateral.editando .mis-solicitudes { display: none; }

/* ---------- Ficha: nombre con los botones de admin a un lado ---------- */
.popup .titulo-ficha { display: flex; align-items: flex-start; gap: 8px; }
.popup .titulo-ficha h2 { flex: 1; min-width: 0; }
.acciones-admin { display: none; }
body.es-admin .acciones-admin { display: flex; gap: 4px; flex-shrink: 0; margin: -4px -4px 0 0; }
.acciones-admin button {
  display: grid; place-items: center;
  width: 30px; height: 30px;
  border: 0; border-radius: 50%;
  background: var(--bg-2);
  color: var(--accent-strong);
  cursor: pointer;
}
.acciones-admin button:hover { background: var(--line); }
.acciones-admin .borrar { color: color-mix(in srgb, #e5484d 80%, var(--fg)); }
.acciones-admin .borrar[aria-pressed="true"] { background: color-mix(in srgb, #e5484d 18%, var(--bg)); }
.acciones-admin svg { width: 16px; height: 16px; }
.popup .confirmar-borrado {
  margin-top: 10px;
  padding: 10px;
  border-radius: 12px;
  background: color-mix(in srgb, #e5484d 10%, var(--bg));
}
.popup .confirmar-borrado p { margin: 0 0 8px; color: var(--fg); font-weight: 600; font-size: 0.85rem; }
.popup .confirmar-borrado div { display: flex; gap: 8px; }
.popup .confirmar-borrado button { padding: 9px; font-size: 0.85rem; }
.popup [hidden] { display: none !important; }
.boton-peligro { background: #d93036 !important; color: #fff !important; }

/* Aviso temporal (p. ej. "se quitó del mapa · Deshacer") */
.aviso {
  position: fixed;
  left: 50%;
  bottom: calc(var(--teclado, 0px) + 140px);
  z-index: 30;
  translate: -50% 0;
  display: flex; align-items: center; gap: 14px;
  max-width: calc(100vw - 32px);
  padding: 10px 10px 10px 16px;
  border-radius: 999px;
  background: var(--fg);
  color: var(--bg);
  box-shadow: var(--shadow);
  font-size: 0.88rem;
  animation: aparecer-aviso 0.2s ease-out;
}
.aviso[hidden] { display: none; }
.aviso span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.aviso button {
  flex-shrink: 0;
  padding: 6px 12px;
  border: 0; border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}
@keyframes aparecer-aviso { from { opacity: 0; transform: translateY(8px); } }
.tarjeta-solicitud .foto-solicitud {
  width: 100%; height: 120px;
  margin-bottom: 10px;
  border-radius: 10px;
  object-fit: cover;
  display: block;
}

/* ---------- Horario por día ---------- */
.panel-cuerpo .opcional { color: var(--muted); font-weight: 400; }
.grupo-horario .ayuda { margin: 0 0 8px; color: var(--muted); font-size: 0.78rem; }
.atajos-horario { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.dias-horario { display: grid; gap: 6px; }
.dia {
  display: grid;
  grid-template-columns: 62px 1fr auto 1fr;
  align-items: center;
  gap: 6px;
  min-height: 40px;
}
.panel-cuerpo .dia .toggle-dia { margin: 0; }
.panel-cuerpo .dia .toggle-dia input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.dia .toggle-dia span {
  display: grid; place-items: center;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg-2);
  color: var(--muted);
  font-weight: 600;
  cursor: pointer;
  user-select: none;
}
.dia .toggle-dia:focus-within span { outline: 2px solid var(--accent); outline-offset: 2px; }
.dia.abierto .toggle-dia span { background: var(--accent); border-color: var(--accent); color: #fff; }
.panel-cuerpo .dia input[type="time"] { margin: 0; padding: 7px 8px; min-width: 0; font-size: 0.88rem; }
.dia .a { color: var(--muted); font-size: 0.8rem; }
.dia .cerrado { display: none; grid-column: 2 / -1; color: var(--muted); font-size: 0.82rem; }
.dia:not(.abierto) input[type="time"], .dia:not(.abierto) .a { display: none; }
.dia:not(.abierto) .cerrado { display: block; }
.horario-anterior { margin-top: 8px !important; }

/* =========================================================
   Diseños alternativos (se eligen en el menú de colores)
   "vivo" es el diseño original: no necesita reglas extra.
   ========================================================= */

/* ---------- Selector de diseño en el menú ---------- */
.muestra-diseno {
  flex-shrink: 0;
  width: 30px; height: 22px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 2px;
  padding: 3px;
  border-radius: 6px;
  border: 1px solid var(--line);
}
.muestra-diseno i { border-radius: 3px; }
.muestra-diseno.vivo i:first-child { background: #7b2cbf; }
.muestra-diseno.vivo i:last-child { background: #e4007c; }
.muestra-diseno.sobrio { background: #f4efe6; }
.muestra-diseno.sobrio i:first-child { background: #b0532f; }
.muestra-diseno.sobrio i:last-child { background: #a8761c; }
.muestra-diseno.minimal { background: #fff; }
.muestra-diseno.minimal i:first-child { background: #141414; }
.muestra-diseno.minimal i:last-child { background: #d4d4d4; }
.texto-diseno { display: flex; flex-direction: column; line-height: 1.25; }
.texto-diseno small { font-size: 0.72rem; font-weight: 400; color: var(--muted); }

/* =========================================================
   SOBRIO: papel cálido, tonos tierra, sombras suaves,
   títulos con tipografía serif y esquinas más contenidas
   ========================================================= */
:root[data-diseno="sobrio"] {
  --bg: #faf7f2;
  --bg-2: #f0ebe2;
  --fg: #2b2620;
  --muted: #7a7166;
  --line: #e2dbcf;
  --shadow: 0 2px 6px rgba(60, 45, 30, 0.08), 0 8px 24px rgba(60, 45, 30, 0.1);
  --radius: 10px;
}
:root[data-diseno="sobrio"][data-theme="dark"] {
  --bg: #24272a;
  --bg-2: #2e3235;
  --fg: #ece7df;
  --muted: #a8a196;
  --line: #3d4245;
  --shadow: 0 2px 6px rgba(0, 0, 0, 0.25), 0 10px 28px rgba(0, 0, 0, 0.35);
}
/* Paletas del modo día */
:root[data-palette="s-terracota"] { --accent: #b0532f; --accent-strong: #8c3f21; --accent-soft: #f5e6dc; --accent-alt: #2f4858; }
:root[data-palette="s-ciruela"] { --accent: #6e3f6b; --accent-strong: #55304f; --accent-soft: #efe3ee; --accent-alt: #b8862b; }
:root[data-palette="s-pizarra"] { --accent: #3a5a73; --accent-strong: #2c475b; --accent-soft: #e1e8ee; --accent-alt: #b8862b; }
:root[data-palette="s-vino"] { --accent: #7c2f40; --accent-strong: #632433; --accent-soft: #f1e1e4; --accent-alt: #a8761c; }
:root[data-palette="s-ocre"] { --accent: #a8761c; --accent-strong: #7d5714; --accent-soft: #f5ecd9; --accent-alt: #3a5a73; }
/* Paletas del modo noche */
:root[data-theme="dark"][data-palette="s-arena"] { --accent: #e2bd7a; --accent-strong: #f0d6a6; --accent-alt: #e08368; }
:root[data-theme="dark"][data-palette="s-barro"] { --accent: #e08368; --accent-strong: #f0b6a5; --accent-alt: #e2bd7a; }
:root[data-theme="dark"][data-palette="s-rosa"] { --accent: #e7a3b3; --accent-strong: #f3cdd6; --accent-alt: #e2bd7a; }
:root[data-theme="dark"][data-palette="s-lavanda"] { --accent: #bba9d8; --accent-strong: #dcd1ec; --accent-alt: #e2bd7a; }

:root[data-diseno="sobrio"] .marca h1,
:root[data-diseno="sobrio"] .popup h2,
:root[data-diseno="sobrio"] .panel-cabecera h2,
:root[data-diseno="sobrio"] .modal h2 {
  font-family: var(--letra-titulo);
  font-weight: 600;
  letter-spacing: 0.005em;
}
:root[data-diseno="sobrio"] .marca h1 { font-size: 1.08rem; }
:root[data-diseno="sobrio"] .marca h1 span { color: var(--accent-strong); font-style: italic; }
:root[data-diseno="sobrio"] .popup h2 { font-size: 1.12rem; }
:root[data-diseno="sobrio"] .tarjeta-ficha .maplibregl-popup-content { border-radius: 12px; }
:root[data-diseno="sobrio"] .modal { border-radius: 14px; }
:root[data-diseno="sobrio"] .pildora { box-shadow: 0 1px 4px rgba(60, 45, 30, 0.12); border-color: var(--line); }
:root[data-diseno="sobrio"] .pildora[aria-pressed="true"] { border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
:root[data-diseno="sobrio"] .boton-principal,
:root[data-diseno="sobrio"] .boton-secundario,
:root[data-diseno="sobrio"] .popup .como-llegar,
:root[data-diseno="sobrio"] .aviso { border-radius: 8px; }
:root[data-diseno="sobrio"] .popup .boton-visita,
:root[data-diseno="sobrio"] .opcion-categoria,
:root[data-diseno="sobrio"] .tarjeta-solicitud,
:root[data-diseno="sobrio"] .popup .fila-mia { border-radius: 8px; }
:root[data-diseno="sobrio"] .campo { border-radius: 10px; }
:root[data-diseno="sobrio"] .panel-lateral { box-shadow: 4px 0 24px rgba(60, 45, 30, 0.16); }
:root[data-diseno="sobrio"] .panel-cuerpo input:not([type="radio"]),
:root[data-diseno="sobrio"] .panel-cuerpo textarea { background: var(--bg); border-radius: 6px; }

/* =========================================================
   MINIMALISTA: sin sombras, líneas finas, esquinas casi rectas,
   todo en blanco/negro/gris y el mapa en escala de grises
   ========================================================= */
:root[data-diseno="minimal"] {
  --bg: #ffffff;
  --bg-2: #f5f5f5;
  --fg: #141414;
  --muted: #7a7a7a;
  --line: #e4e4e4;
  --shadow: 0 0 0 1px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.04);
  --radius: 4px;
}
:root[data-diseno="minimal"][data-theme="dark"] {
  --bg: #141414;
  --bg-2: #1e1e1e;
  --fg: #f2f2f2;
  --muted: #8f8f8f;
  --line: #2c2c2c;
  --shadow: 0 0 0 1px rgba(255, 255, 255, 0.1);
}
:root[data-palette="m-tinta"] { --accent: #141414; --accent-strong: #141414; --accent-soft: #f0f0f0; --accent-alt: #e5484d; }
:root[data-palette="m-grafito"] { --accent: #5a5a5a; --accent-strong: #3a3a3a; --accent-soft: #f0f0f0; --accent-alt: #141414; }
:root[data-palette="m-rojo"] { --accent: #e5484d; --accent-strong: #c22f35; --accent-soft: #fdecec; --accent-alt: #141414; }
:root[data-palette="m-azul"] { --accent: #2f6fed; --accent-strong: #1f56c4; --accent-soft: #e9f0fd; --accent-alt: #141414; }
:root[data-theme="dark"][data-palette="m-blanco"] { --accent: #f2f2f2; --accent-strong: #ffffff; --accent-alt: #ff6369; }
:root[data-theme="dark"][data-palette="m-rojo"] { --accent: #ff6369; --accent-strong: #ff9a9e; --accent-alt: #f2f2f2; }
:root[data-theme="dark"][data-palette="m-ambar"] { --accent: #f5b83d; --accent-strong: #f8d185; --accent-alt: #f2f2f2; }
/* En minimalista oscuro el tinte es un gris, no un color */
:root[data-diseno="minimal"][data-theme="dark"][data-palette="m-blanco"] { --accent-soft: #262626; }

:root[data-diseno="minimal"] body { letter-spacing: -0.005em; }
:root[data-diseno="minimal"] .marca h1 { font-size: 0.95rem; font-weight: 600; letter-spacing: -0.01em; }
:root[data-diseno="minimal"] .marca h1 span { color: var(--muted); font-weight: 400; }
:root[data-diseno="minimal"] .estado { font-size: 0.75rem; }
:root[data-diseno="minimal"] .popup h2,
:root[data-diseno="minimal"] .panel-cabecera h2,
:root[data-diseno="minimal"] .modal h2 { font-weight: 600; letter-spacing: -0.01em; }
/* Títulos de sección en versalitas pequeñas */
:root[data-diseno="minimal"] .paletas .titulo,
:root[data-diseno="minimal"] .panel-cuerpo legend {
  text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.68rem; font-weight: 600; color: var(--muted);
}
/* Botones redondos → cuadrados con esquinas mínimas */
:root[data-diseno="minimal"] .boton-icono,
:root[data-diseno="minimal"] .cerrar-panel,
:root[data-diseno="minimal"] .cerrar-modal,
:root[data-diseno="minimal"] .limpiar,
:root[data-diseno="minimal"] .acciones-admin button { border-radius: var(--radius); }
:root[data-diseno="minimal"] .campo,
:root[data-diseno="minimal"] .pildora,
:root[data-diseno="minimal"] .boton-principal,
:root[data-diseno="minimal"] .boton-secundario,
:root[data-diseno="minimal"] .popup .como-llegar,
:root[data-diseno="minimal"] .popup .boton-visita,
:root[data-diseno="minimal"] .popup .fila-mia,
:root[data-diseno="minimal"] .opcion-categoria,
:root[data-diseno="minimal"] .tarjeta-solicitud,
:root[data-diseno="minimal"] .segmentos,
:root[data-diseno="minimal"] .segmentos button,
:root[data-diseno="minimal"] .chip,
:root[data-diseno="minimal"] .campo-etiquetas,
:root[data-diseno="minimal"] .campo-etiquetas li,
:root[data-diseno="minimal"] .vista-foto,
:root[data-diseno="minimal"] .aviso,
:root[data-diseno="minimal"] .aviso button,
:root[data-diseno="minimal"] .paletas button,
:root[data-diseno="minimal"] .resultados li,
:root[data-diseno="minimal"] .maplibregl-ctrl-group,
:root[data-diseno="minimal"] .tarjeta-ficha .maplibregl-popup-content,
:root[data-diseno="minimal"] .modal,
:root[data-diseno="minimal"] .panel-cuerpo input:not([type="radio"]),
:root[data-diseno="minimal"] .panel-cuerpo textarea { border-radius: var(--radius); }
:root[data-diseno="minimal"] .panel-cuerpo input:not([type="radio"]),
:root[data-diseno="minimal"] .panel-cuerpo textarea { background: var(--bg); }
/* Sin sombras: solo contornos finos */
:root[data-diseno="minimal"] .pildora { box-shadow: none; border-color: var(--line); }
:root[data-diseno="minimal"] .pildora[aria-pressed="true"] {
  background: var(--fg); color: var(--bg); border-color: var(--fg); font-weight: 500;
}
:root[data-diseno="minimal"] .pildora[aria-pressed="true"] svg { color: var(--bg); }
:root[data-diseno="minimal"] .pildora svg { color: var(--fg); }
:root[data-diseno="minimal"] .panel-lateral { box-shadow: none; border-right: 1px solid var(--line); }
:root[data-diseno="minimal"] .modal { box-shadow: 0 0 0 1px var(--line); }
:root[data-diseno="minimal"] .boton-principal { font-weight: 500; }
:root[data-diseno="minimal"] .campo:focus-within { outline: 1px solid var(--fg); }
@media (max-width: 480px) {
  :root[data-diseno="minimal"] .modal { border-radius: 6px 6px 0 0; }
}
.opciones-categoria .opcion-categoria:last-child:nth-child(odd) { grid-column: span 2; }

input, textarea, select { font-family: inherit; }
.marca h1, .popup h2, .panel-cabecera h2, .modal h2 { font-family: var(--letra-titulo); }

/* ---------- Enlace de Google Maps en el formulario ---------- */
.grupo-maps { margin-bottom: 14px; }
.grupo-maps > label { margin-bottom: 4px; }
.fila-maps { display: flex; gap: 8px; align-items: stretch; }
.fila-maps input { flex: 1; min-width: 0; }
.panel-cuerpo .fila-maps input { margin-top: 0; }
.fila-maps .boton-pegar { width: auto; flex: none; padding: 0 16px; }
.fila-maps .boton-pegar[hidden] { display: none; }
.boton-buscar-maps {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin-top: 8px; text-decoration: none; font-size: 0.85rem;
}
.boton-buscar-maps svg { width: 17px; height: 17px; }
.grupo-maps .aviso-maps { margin: 6px 0 0; font-size: 0.8rem; color: var(--muted); }
.pasos-maps { margin: 0 0 8px; padding-left: 18px; font-size: 0.75rem; line-height: 1.45; color: var(--muted); }
.pasos-maps li::marker { color: var(--muted); }

/* =========================================================
   Ficha del lugar en el panel izquierdo
   ========================================================= */
.panel-ficha { z-index: 1150; }
.panel-ficha .cerrar-ficha {
  position: sticky;
  top: 12px;
  z-index: 2;
  display: grid; place-items: center;
  width: 38px; height: 38px;
  margin: 12px 12px -50px auto; /* flota sobre la foto, a la derecha */
  border: 0; border-radius: 50%;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  color: var(--fg);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(6px);
  cursor: pointer;
}
.panel-ficha .cerrar-ficha svg { width: 20px; height: 20px; }
.panel-ficha .cerrar-ficha:hover { background: var(--bg); }
.panel-ficha .popup { padding: 0 20px 24px; font-size: 0.95rem; line-height: 1.5; }
.panel-ficha .popup .foto { height: 230px; margin: 0 -20px 16px; }
.panel-ficha .popup .foto.sin-foto { height: 120px; }
:root .panel-ficha .popup .titulo-ficha h2 { font-size: 1.45rem; line-height: 1.2; margin-bottom: 6px; }
.panel-ficha .popup p { margin: 4px 0; }
.panel-ficha .popup .chips-ficha { margin: 10px 0 8px; }
.panel-ficha .popup .calificacion { margin-top: 14px; }
.panel-ficha .popup .botones-ficha { margin-top: 16px; }
@media (max-height: 480px) and (orientation: landscape) {
  .panel-ficha .popup .foto { height: 140px; }
}

/* Burbuja con el nombre al pasar el mouse sobre un pin */
.burbuja-nombre { pointer-events: none; z-index: 5; }
.burbuja-nombre .maplibregl-popup-content {
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--bg);
  color: var(--fg);
  box-shadow: var(--shadow);
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.burbuja-nombre.maplibregl-popup-anchor-bottom .maplibregl-popup-tip { border-top-color: var(--bg); }

/* Con la ficha abierta en pantallas anchas, el buscador y las categorías se centran en el espacio libre */
.buscador { transition: left 0.25s ease, width 0.25s ease; }
@media (min-width: 700px) {
  body.con-ficha .buscador {
    left: calc(50% + min(380px, 100vw) / 2);
    width: min(640px, calc(100% - min(380px, 100vw) - 32px));
  }
}

/* ---------- Sugerir un cambio (usuarios regulares) ---------- */
.popup .sugerir-cambio {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  width: 100%;
  margin-top: 8px;
  padding: 6px;
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 0.78rem;
  cursor: pointer;
}
.popup .sugerir-cambio svg { width: 14px; height: 14px; }
.popup .sugerir-cambio:hover { color: var(--accent-strong); text-decoration: underline; }
body.es-admin .popup .sugerir-cambio { display: none; } /* el admin edita directo con el lápiz */
.panel-lateral.editando.proponiendo .campo-notas { display: block; }
.mis-solicitudes .tipo-cambio { color: var(--muted); font-weight: 400; }

/* ---------- Panel de admin: lugar nuevo vs. edición de información ---------- */
.tarjeta-solicitud .tipo-solicitud {
  display: inline-block;
  margin: 0 0 6px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.tipo-solicitud.nuevo { background: var(--accent-soft); color: var(--accent-strong); }
.tipo-solicitud.cambio { background: color-mix(in srgb, #3b82f6 18%, var(--bg)); color: color-mix(in srgb, #3b82f6 75%, var(--fg)); }
.tarjeta-solicitud.es-cambio { border-left: 3px solid color-mix(in srgb, #3b82f6 70%, var(--bg)); }
.tarjeta-solicitud table.cambios { width: 100%; margin: 8px 0; border-collapse: collapse; font-size: 0.8rem; }
.cambios th, .cambios td { padding: 5px 6px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.cambios thead th { font-size: 0.7rem; font-weight: 600; color: var(--muted); }
.cambios tbody th { width: 28%; font-weight: 600; color: var(--muted); }
.cambios td:first-of-type { color: var(--muted); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--muted) 60%, transparent); }
.cambios td:last-child { color: var(--fg); font-weight: 600; }

/* Con la tarjeta de un lugar abierta (celular), la barra de arriba se oculta para darle espacio */
.topbar { transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s; }
body.con-tarjeta .topbar {
  opacity: 0;
  visibility: hidden;
  transform: translateY(-12px);
  pointer-events: none;
}

/* Teléfono del lugar en el color de acento del tema */
.popup a[href^="tel:"] { color: var(--accent); font-weight: 600; text-decoration-color: color-mix(in srgb, var(--accent) 50%, transparent); }

/* ---------- Celular: buscador oculto hasta tocar la lupa (las píldoras siguen visibles) ---------- */
.boton-buscar { display: none; }
body.modo-movil .boton-buscar { display: grid; }
body.modo-movil .boton-buscar[aria-pressed="true"] { background: var(--accent); color: var(--bg); }
body.modo-movil:not(.buscando) .buscador .campo,
body.modo-movil:not(.buscando) .buscador .resultados { display: none; }

/* ---------- Menú de filtros ---------- */
.menu-filtros {
  position: fixed;
  top: max(12px, env(safe-area-inset-top));
  right: calc(max(16px, env(safe-area-inset-right)) + 54px); /* a la izquierda de la columna de botones */
  z-index: 1050;
  width: min(320px, calc(100vw - 32px - 54px));
  max-height: calc(var(--alto-visible, 100dvh) - 32px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 14px 16px 16px;
  background: var(--bg);
  color: var(--fg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.menu-filtros[hidden] { display: none; }
.cabecera-filtros { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.cabecera-filtros h2 { margin: 0; font-family: var(--letra-titulo); font-size: 1.15rem; }
.cerrar-filtros {
  width: 32px; height: 32px; border: 0; border-radius: 50%;
  background: var(--bg-2); color: var(--muted); font-size: 22px; line-height: 1; cursor: pointer;
}
.menu-filtros fieldset { margin: 0; padding: 10px 0; border: 0; border-top: 1px solid var(--line); }
.menu-filtros legend { padding: 0; margin-bottom: 8px; font-size: 0.78rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.menu-filtros legend { float: left; width: 100%; }
.menu-filtros legend + * { clear: both; }
.opciones-filtro { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-filtro {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg-2);
  color: var(--fg);
  font: inherit; font-size: 0.82rem;
  cursor: pointer;
}
.chip-filtro svg { width: 15px; height: 15px; color: var(--accent-strong); fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.chip-filtro[aria-pressed="true"] {
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  color: var(--accent-strong);
  font-weight: 600;
}
.interruptor { display: flex; align-items: center; gap: 10px; font-size: 0.9rem; cursor: pointer; }
.interruptor input {
  appearance: none; -webkit-appearance: none;
  position: relative; flex: none;
  width: 40px; height: 24px; margin: 0;
  border-radius: 999px; background: var(--line);
  cursor: pointer; transition: background 0.15s;
}
.interruptor input::after {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 18px; height: 18px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  transition: transform 0.15s;
}
.interruptor input:checked { background: var(--accent); }
.interruptor input:checked::after { transform: translateX(16px); }
.interruptor input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ayuda-filtro { margin: 6px 0 0; font-size: 0.75rem; color: var(--muted); }
.pie-filtros { display: flex; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.pie-filtros .boton-secundario { flex: 0 0 auto; width: auto; padding: 10px 16px; }
.pie-filtros .boton-principal { flex: 1; padding: 10px; }
.pie-filtros button:disabled { opacity: 0.5; cursor: default; }

/* Abierto / cerrado en la ficha */
.popup .estado-horario { font-weight: 600; font-size: 0.85rem; }
.popup .estado-horario.abierto { color: var(--visitado); }
.popup .estado-horario.cerrado { color: #e5484d; }
:root[data-theme="dark"] .popup .estado-horario.cerrado { color: #ff8a8e; }

/* Admin: pestaña "Quitados" */
.tipo-solicitud.quitado { background: color-mix(in srgb, #e5484d 16%, var(--bg)); color: color-mix(in srgb, #e5484d 80%, var(--fg)); }
.nota-admin { margin: 12px 0 0; font-size: 0.78rem; color: var(--muted); }
/* Sin el campo de búsqueda, los créditos del mapa bajan junto a las píldoras */
body.modo-movil:not(.buscando) .maplibregl-ctrl-bottom-left,
body.modo-movil:not(.buscando) .maplibregl-ctrl-bottom-right { bottom: calc(max(16px, env(safe-area-inset-bottom)) + 52px); }

/* ---------- Burbuja de ayuda al pasar el puntero por los botones (solo escritorio) ---------- */
.ayuda-boton {
  position: fixed;
  z-index: 1200;
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--bg);
  color: var(--fg);
  box-shadow: var(--shadow);
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translateX(var(--desde, 4px));
  transition: opacity 0.12s, transform 0.12s;
}
.ayuda-boton.visible { opacity: 1; transform: none; }
:root[data-diseno="minimal"] .ayuda-boton { border-radius: 4px; }

/* ---------- Panel del perfil ---------- */
.boton-cuenta .inicial.con-foto { background: var(--bg-2); overflow: hidden; }
.boton-cuenta .inicial img { width: 100%; height: 100%; object-fit: cover; display: block; }
.boton-cuenta[aria-expanded="true"] .inicial { outline: 2px solid var(--accent); outline-offset: 2px; }
.foto-perfil { display: flex; align-items: center; gap: 16px; margin: 4px 0 20px; }
.avatar-grande {
  width: 84px; height: 84px; flex-shrink: 0;
  border-radius: 50%;
  overflow: hidden;
  display: grid; place-items: center;
  background: var(--accent);
  color: var(--bg);
  font-family: var(--letra-titulo);
  font-size: 2.2rem; font-weight: 700;
}
.avatar-grande img { width: 100%; height: 100%; object-fit: cover; }
.avatar-grande [hidden] { display: none; }
.botones-foto-perfil { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.panel-cuerpo .boton-archivo {
  position: relative;
  width: auto; margin: 0; padding: 9px 16px;
  font-size: 0.86rem;
  text-align: center;
}
.panel-cuerpo .boton-archivo:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.boton-archivo input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; margin: 0; }
.enlace-quitar {
  border: 0; background: none; padding: 2px 4px;
  color: var(--muted); font-size: 0.82rem; text-decoration: underline; cursor: pointer;
}
.enlace-quitar:hover { color: var(--fg); }
.panel-perfil .ayuda { display: block; margin-top: 6px; color: var(--muted); font-weight: 400; font-size: 0.78rem; }
.panel-perfil .dato-usuario { margin: 0 0 16px; color: var(--muted); font-size: 0.85rem; }
.panel-perfil .dato-usuario strong { color: var(--fg); }
.panel-perfil .ok { margin: 0 0 12px; color: var(--accent-strong); font-size: 0.85rem; font-weight: 600; }
.panel-perfil .ok[hidden], .panel-perfil .error[hidden] { display: none; }
.panel-perfil .cerrar-sesion { margin-top: 10px; }

/* ---------- Crear cuenta y códigos por correo ---------- */
.modal .cambiar-vista { margin: 14px 0 0; text-align: center; font-size: 0.86rem; color: var(--muted); }
.enlace {
  border: 0; background: none; padding: 0;
  color: var(--accent); font: inherit; font-weight: 600;
  text-decoration: underline; text-underline-offset: 2px; cursor: pointer;
}
.enlace:disabled { opacity: 0.6; cursor: progress; }
.modal .opcional { color: var(--muted); font-weight: 400; }
.campo-codigo { letter-spacing: 0.35em; font-variant-numeric: tabular-nums; font-size: 1.15rem; text-align: center; }
.aviso-prueba {
  margin: 0 0 12px; padding: 8px 10px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 14%, var(--bg));
  font-size: 0.8rem; color: var(--fg);
}
.aviso-prueba[hidden], .confirmar-correo[hidden] { display: none; }
.confirmar-correo {
  margin: -4px 0 16px; padding: 12px;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--bg-2);
  font-size: 0.84rem;
}
.confirmar-correo p { margin: 0 0 10px; }
.fila-codigo { display: flex; gap: 8px; margin-bottom: 8px; }
.panel-cuerpo .fila-codigo input { margin: 0; flex: 1; min-width: 0; }
.fila-codigo .boton-secundario { width: auto; padding: 0 16px; }
.confirmar-correo .enlace { font-size: 0.82rem; }

/* ---------- Reseñas ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ver-resenas {
  display: flex; align-items: center; gap: 7px;
  width: 100%; margin-top: 8px; padding: 9px 12px;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--bg-2); color: var(--fg);
  font-size: 0.85rem; text-align: left; cursor: pointer;
}
.ver-resenas:hover { border-color: var(--accent); }
.ver-resenas svg { width: 18px; height: 18px; flex-shrink: 0; color: var(--accent); }
.ver-resenas .accion { margin-left: auto; color: var(--accent); font-weight: 600; white-space: nowrap; }
.panel-resenas { z-index: 1150; } /* encima de la ficha */
.panel-resenas .lugar-resenas { margin: -4px 0 14px; font-family: var(--letra-titulo); font-size: 1.05rem; font-weight: 600; color: var(--accent-strong); }
.panel-resenas h3 { margin: 0 0 10px; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.panel-resenas section + section { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.lista-resenas { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 16px; }
.resena header { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.resena header div { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 8px; min-width: 0; }
.resena header strong { font-size: 0.9rem; }
.resena header small { width: 100%; color: var(--muted); font-size: 0.75rem; }
.avatar-resena {
  width: 34px; height: 34px; flex-shrink: 0;
  border-radius: 50%; object-fit: cover;
  display: grid; place-items: center;
  background: var(--accent); color: var(--bg); font-weight: 700;
}
.estrellas-resena { color: var(--accent); font-size: 0.8rem; letter-spacing: 1px; }
.estrellas-resena span { color: var(--line); }
.resena p { margin: 0; font-size: 0.9rem; line-height: 1.5; white-space: pre-line; overflow-wrap: anywhere; }
.resena .reportar {
  margin-top: 6px; padding: 0; border: 0; background: none;
  color: var(--muted); font-size: 0.75rem; text-decoration: underline; cursor: pointer;
}
.resena .reportar:hover { color: var(--fg); }
.resena .reportada { display: inline-block; margin-top: 6px; color: var(--muted); font-size: 0.75rem; }
.resena.propia { padding: 12px; border-radius: 10px; background: var(--bg-2); }
.vacio-resenas { color: var(--muted); font-size: 0.88rem; }
.nota-resena { margin: 0 0 10px; color: var(--muted); font-size: 0.86rem; }
.nota-resena.nota-oculta { margin-top: 10px; color: var(--fg); }
.tu-resena .boton-secundario { width: auto; padding: 9px 18px; font-size: 0.86rem; }
.acciones-resena { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.form-resena textarea { margin-top: 0 !important; resize: vertical; min-height: 96px; }
.pie-resena { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; }
.pie-resena > div { display: flex; align-items: center; gap: 12px; }
.pie-resena .boton-principal { width: auto; padding: 9px 20px; }
.contador-resena { color: var(--muted); font-size: 0.75rem; }
.form-resena .error { margin-top: 8px; }
.tipo-solicitud.reportada { background: color-mix(in srgb, #e5484d 16%, var(--bg)); color: color-mix(in srgb, #e5484d 80%, var(--fg)); }
.texto-reportado {
  margin: 8px 0 10px; padding: 8px 12px;
  border-left: 3px solid var(--line);
  font-size: 0.88rem; white-space: pre-line; overflow-wrap: anywhere;
}

/* Tarjeta del celular: solo "Abierto · cierra a las…"; el horario completo va en la ficha de escritorio */
.tarjeta-ficha .horario-completo { display: none; }

/* ---------- Nombre del sitio (abre "Acerca de") ---------- */
.nombre-sitio {
  all: unset;
  cursor: pointer;
  border-radius: 4px;
}
.nombre-sitio:hover span { text-decoration: underline; text-underline-offset: 3px; }
.nombre-sitio:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.modal-acerca { width: min(440px, calc(100% - 32px)); max-height: calc(100dvh - 48px); overflow-y: auto; }
.modal-acerca h2 { padding-right: 36px; font-family: var(--letra-titulo); }
.modal-acerca h2 span { color: var(--accent-strong); }
:root[data-diseno="sobrio"] .modal-acerca h2 span { font-style: italic; }
.modal-acerca section { padding: 12px 0; border-top: 1px solid var(--line); }
.modal-acerca h3 {
  margin: 0 0 4px; font-size: 0.72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted);
}
.modal-acerca section p { margin: 0; font-size: 0.92rem; line-height: 1.5; }
.modal-acerca a { color: var(--accent-strong); font-weight: 600; overflow-wrap: anywhere; }

/* ---------- Hasta 2 categorías por lugar ---------- */
.ayuda-legend { font-weight: 500; color: var(--muted); font-size: 0.78rem; }
.ayuda-categoria { margin: 0 0 8px; font-size: 0.8rem; color: var(--muted); }
.opcion-categoria:has(input:disabled) { opacity: 0.45; cursor: not-allowed; }
.orden-categoria {
  margin-left: auto;
  font-size: 0.66rem; font-weight: 700; letter-spacing: 0.02em;
  padding: 2px 6px; border-radius: 999px;
  background: var(--accent); color: var(--bg);
}
.orden-categoria:empty { display: none; }
.chips-categoria { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; flex-shrink: 0; }
