/* Portal: Mi Cumbre, la ficha de una salida y la sección Celular.
   Se apoya en css/estilo.css (variables, panel, boton, lista, aviso…). */

.menu-portal {
  color: var(--text-dim);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  padding: 6px 10px;
  border-radius: 8px;
}
.menu-portal:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }
.menu-portal.activo { color: var(--text); background: rgba(238, 121, 47, 0.14); }

.cabecera-vista {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin: 22px 0 14px;
}
.cabecera-vista h1 { margin: 0; font-size: clamp(22px, 3vw, 30px); }
.cabecera-vista .sub { margin: 4px 0 0; }
.titulo-lista { margin: 0; font-size: 20px; }
.volver { display: inline-block; margin-top: 18px; color: var(--text-dim); text-decoration: none; font-size: 14px; }
.volver:hover { color: var(--text); }
.separador { border: 0; border-top: 1px solid var(--border); margin: 20px 0; }
.lista-ayuda { color: var(--text-dim); font-size: 14.5px; padding-left: 20px; margin: 0; }
.lista-ayuda li { margin-bottom: 8px; }

/* ------------------------------------------------------------- progreso */
.tarjetas-progreso {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}
.tarjetas-progreso .dato {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
}
.tarjetas-progreso strong { display: block; font-size: 24px; line-height: 1.1; }
.tarjetas-progreso span { color: var(--text-dim); font-size: 13px; }
.tarjetas-progreso small { display: block; color: var(--text-faint); font-size: 12px; margin-top: 4px; }

/* Gráfico de progreso: SVG estirado al ancho + puntos y etiqueta en HTML. */
.grafico-cabecera {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px 20px;
  flex-wrap: wrap;
}
.grafico-cabecera h2 { margin: 0; }
.grafico-cabecera .sub { margin: 4px 0 0; }
.grafico-controles { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.grafico-controles select,
.rango-fechas input {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 999px;
  padding: 7px 12px;
  font: inherit;
  font-size: 13px;
}
.grafico-controles select option { background: #fff; }
.segmentado {
  display: inline-flex;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px;
}
.segmentado button {
  background: none;
  border: 0;
  color: var(--text-dim);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
}
.segmentado button:hover { color: var(--text); }
.segmentado button.activo { background: #ee762c; color: #fff; }
.grafico-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 14px 0 4px;
}
.grafico-nav .nota { text-align: center; flex: 1; }
.grafico-nav button:disabled { opacity: 0.3; cursor: default; }
.grafico-svg { position: relative; height: 220px; }
.grafico-dibujo { display: block; width: 100%; height: 100%; overflow: visible; }
.g-guia { stroke: var(--border); stroke-width: 1; }
.g-eje { fill: var(--text-faint); font-size: 11px; }
.g-barra { fill: #cd5911; transition: fill 0.15s; }
.g-barra.elegido { fill: #ee762c; }
.g-linea { fill: none; stroke: #ee762c; stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.g-area { fill: rgba(238, 121, 47, 0.18); }
.g-zona { fill: transparent; cursor: pointer; }
.g-zona:hover { fill: rgba(255, 255, 255, 0.04); }
.g-punto {
  position: absolute;
  width: 8px;
  height: 8px;
  margin: -4px 0 0 -4px;
  border-radius: 50%;
  background: var(--bg, #fcf9f5);
  border: 2px solid #ee762c;
  pointer-events: none;
}
.g-punto.cero { border-color: var(--text-faint); }
.g-punto.elegido { width: 13px; height: 13px; margin: -6.5px 0 0 -6.5px; background: #ee762c; }
.g-valor {
  position: absolute;
  transform: translate(-50%, -135%);
  background: #fff;
  border: 1px solid #ee762c;
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
  pointer-events: none;
}
@media (max-width: 720px) {
  .grafico-svg { height: 190px; }
  .segmentado button { padding: 5px 9px; font-size: 12px; }
}

/* -------------------------------------------------------------- salidas */
.grilla-salidas {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
.salida-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.salida-card:hover { border-color: rgba(238, 121, 47, 0.5); box-shadow: 0 14px 34px rgba(70, 55, 45, 0.22); }
.salida-card .portada {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, #f4d4b4, #efd4b9) center/cover no-repeat;
}
.salida-card .cuenta-fotos,
.chip-vis {
  position: absolute;
  font-size: 11.5px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(18, 22, 32, 0.8);
  color: #fff;
}
.salida-card .cuenta-fotos { right: 10px; bottom: 10px; }
.salida-card .chip-vis { left: 10px; top: 10px; }
.chip-vis.vis-publica { color: #b3770f; }
.chip-vis.vis-amigos { color: #cd5911; }
.chip-vis.vis-privada { color: var(--text-dim); }
.cabecera-vista .chip-vis { position: static; }
.salida-card .cuerpo { padding: 14px 16px 16px; }
.salida-card .titulo { color: var(--text); font-weight: 700; text-decoration: none; font-size: 16px; }
.salida-card .titulo:hover { color: #cd5911; }
.salida-card .fecha { color: var(--text-faint); font-size: 12px; margin: 4px 0 0; }
.salida-card .numeros { color: var(--text-dim); font-size: 13px; margin: 6px 0 0; }

.filtros-portal { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.filtros-portal input[type='search'] { flex: 1 1 220px; }
.rango-fechas { display: inline-flex; gap: 6px; align-items: center; }
.rango-fechas input { min-height: 40px; color-scheme: dark; }
.resumen-filtro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  background: rgba(238, 121, 47, 0.1);
  border: 1px solid rgba(238, 121, 47, 0.35);
  border-radius: 12px;
  padding: 10px 14px;
  margin-bottom: 14px;
  font-size: 14px;
}
.filtros-portal input,
.filtros-portal select {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 999px;
  padding: 9px 14px;
  font: inherit;
  font-size: 14px;
  min-height: 40px;
}
.filtros-portal select option { background: #fff; }

/* ------------------------------------------------------ una actividad */
#mapaActividad {
  height: 340px;
  border-radius: 16px;
  border: 1px solid var(--border);
  overflow: hidden;
  margin-bottom: 16px;
  background: #fff;
}
.compartir-fila { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.compartir-fila select {
  flex: 1 1 180px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  font-size: 14px;
}
.compartir-fila select option { background: #fff; }

.grilla-fotos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px;
  margin-top: 14px;
}
.grilla-fotos .foto {
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface);
}
.grilla-fotos .foto.portada { border-color: #cf8911; }
.grilla-fotos img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
  cursor: zoom-in;
}
.acciones-foto { display: flex; gap: 4px; padding: 6px; }
.acciones-foto .mini {
  flex: 1;
  font: inherit;
  font-size: 11.5px;
  font-weight: 600;
  padding: 5px 4px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
}
.acciones-foto .mini:hover:not(:disabled) { color: var(--text); border-color: #ee762c; }
.acciones-foto .mini:disabled { opacity: 0.5; cursor: default; }
.acciones-foto .mini.peligro { color: #ff6b6b; }

.visor-portal {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(6, 7, 10, 0.94);
  display: flex;
  align-items: center;
  justify-content: center;
}
.visor-portal img { max-width: 92vw; max-height: 88vh; object-fit: contain; border-radius: 8px; }
.visor-portal .v-cerrar {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
}

.campo textarea {
  width: 100%;
  background: var(--surface-alt, #fbf7f2);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  padding: 10px 12px;
  font: inherit;
  font-size: 15px;
  resize: vertical;
}
.campo select {
  width: 100%;
  background: var(--surface-alt, #fbf7f2);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  padding: 10px 12px;
  font: inherit;
  font-size: 15px;
}
.campo select option { background: #fff; }

@media (max-width: 720px) {
  /* La barra de arriba se salía de la pantalla con el nombre y "Cerrar sesión". */
  header.barra { flex-wrap: wrap; row-gap: 6px; }
  header.barra nav { flex-wrap: wrap; justify-content: flex-end; gap: 4px; }
  #quien { display: none; }
  .cabecera-vista { align-items: flex-start; }
  #mapaActividad { height: 240px; }
  .menu-portal { padding: 6px 8px; font-size: 13px; }
}

/* ------------------------------------------------------------------ chat */
.chat-caja {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 16px;
  align-items: stretch;
  min-height: 60vh;
}
.chat-lista {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px;
  overflow: auto;
  max-height: 70vh;
}
.chat-lista h3 {
  margin: 10px 0 6px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-faint);
}
.chat-lista h3:first-child { margin-top: 0; }
.chat-hilos { list-style: none; margin: 0; padding: 0; }
.chat-hilos li { margin-bottom: 4px; }
.chat-hilos button {
  width: 100%;
  text-align: left;
  font: inherit;
  font-size: 14px;
  color: var(--text-dim);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 9px 10px;
  cursor: pointer;
}
.chat-hilos button:hover { background: rgba(255, 255, 255, 0.05); color: var(--text); }
.chat-hilos button.activo {
  background: rgba(238, 121, 47, 0.14);
  border-color: rgba(238, 121, 47, 0.4);
  color: var(--text);
  font-weight: 600;
}
.chat-panel {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  max-height: 70vh;
}
.chat-cabecera {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.volver-chat {
  display: none;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  border-radius: 8px;
  width: 32px;
  height: 32px;
  font-size: 16px;
  cursor: pointer;
}
.chat-mensajes {
  flex: 1;
  overflow: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.burbuja {
  max-width: 78%;
  padding: 9px 13px;
  border-radius: 14px;
  background: var(--surface-alt, #fbf7f2);
  border: 1px solid var(--border);
  font-size: 14.5px;
  line-height: 1.4;
  word-break: break-word;
}
.burbuja.mia { align-self: flex-end; background: rgba(238, 121, 47, 0.18); border-color: rgba(238, 121, 47, 0.35); }
.burbuja .quien { display: block; font-size: 11.5px; color: var(--text-faint); margin-bottom: 2px; }
.burbuja .hora { display: block; font-size: 11px; color: var(--text-faint); text-align: right; margin-top: 3px; }
.burbuja.aviso-track { align-self: center; background: rgba(236, 157, 21, 0.12); border-color: rgba(236, 157, 21, 0.35); font-size: 13px; }
.chat-enviar { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--border); }
.chat-enviar input {
  flex: 1;
  background: var(--surface-alt, #fbf7f2);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  padding: 10px 16px;
  font: inherit;
  font-size: 15px;
}
.chat-enviar input:disabled { opacity: 0.6; }

@media (max-width: 760px) {
  .chat-caja { grid-template-columns: 1fr; }
  .chat-caja.en-conversacion .chat-lista { display: none; }
  .chat-caja:not(.en-conversacion) .chat-panel { display: none; }
  .chat-caja.en-conversacion .volver-chat { display: block; }
  .chat-panel, .chat-lista { max-height: none; height: 70vh; }
}
.mini-ruta { position: absolute; inset: 10px; width: calc(100% - 20px); height: calc(100% - 20px); }

/* Elegir varias salidas */
.barra-lote { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.lote-acciones { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.lote-acciones button:disabled { opacity: 0.4; cursor: default; }
.salida-card.eligiendo { cursor: pointer; position: relative; }
.salida-card.eligiendo a { pointer-events: none; }
.salida-card.elegida { border-color: #ee762c; box-shadow: 0 0 0 2px #ee762c; }
.marca-eleccion {
  position: absolute; z-index: 3; right: 10px; top: 10px; width: 28px; height: 28px; border-radius: 8px;
  display: grid; place-items: center; font-weight: 800; color: #fff;
  background: rgba(18, 22, 32, 0.85); border: 2px solid rgba(255, 255, 255, 0.6);
}
.salida-card.elegida .marca-eleccion { background: #ee762c; border-color: #ee762c; }
.cabecera-acciones { display: flex; gap: 10px; align-items: center; }

footer .enlace-pie { color: var(--text-faint); }

/* ------------------------------ los senderos del sitio, en la vista Celular
   Prefijo "sp-" a propósito: en este proyecto los nombres cortos ya están
   tomados y reusar uno (.aviso, .vacio) costó dos tardes de buscar por qué se
   desarmaba una tarjeta. Lo que sí se reusa es .lista, que es justo el mismo
   componente que "Tus rutas" de abajo. */
.sp-filtros { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.sp-buscar, .sp-zona {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radio);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  padding: 9px 12px;
}
.sp-buscar { flex: 1; min-width: 150px; }
.sp-buscar:focus, .sp-zona:focus { outline: none; border-color: var(--primary); }
/* Una lista larga de senderos empujaría "Tus rutas" fuera de la pantalla. */
.sp-lista { max-height: 340px; overflow-y: auto; padding-right: 2px; }
.sp-boton {
  background: var(--primary-soft);
  border: 1px solid var(--primary);
  border-radius: 999px;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  padding: 7px 12px;
  white-space: nowrap;
}
.sp-boton:hover { background: var(--primary); }
.sp-boton:disabled { opacity: .55; cursor: default; }
.sp-ya { color: #b3770f; font-size: 12px; margin-top: 2px; }

/* Salidas del reloj (2026-10-24) */
.ayuda-reloj { margin-top: 12px; font-size: .9rem; }
.ayuda-reloj summary { cursor: pointer; font-weight: 600; }
.ayuda-reloj code { font-size: .85em; }

/* Sección Garmin: una sola columna (no hay mapa al lado). */
.portal.portal-una { grid-template-columns: minmax(0, 720px); justify-content: center; }
.gm-lista { max-height: none; }
.gm-lista li { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
