/* ===== Rumbo — diseño pensado para 50–70 años: alto contraste, targets grandes ===== */
:root {
  --verde: #007A33;
  --verde-oscuro: #005A26;
  --naranja: #F26522;
  --crema: #FAF7F2;
  --texto: #1F2937;
  --gris: #6B7280;
  --borde: #E5E0D8;
  --blanco: #FFFFFF;
  --radio: 14px;
  --fs-base: 17px;
}
html.big-text { --fs-base: 20px; }

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: var(--fs-base);
  color: var(--texto);
  background: var(--crema);
  display: flex; flex-direction: column;
  height: 100dvh; overflow: hidden;
}

/* ===== Header ===== */
.app-header {
  background: var(--verde);
  color: var(--blanco);
  padding: calc(env(safe-area-inset-top) + 10px) 16px 10px;
  flex-shrink: 0;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-compass { width: 42px; height: 42px; background: var(--blanco); border-radius: 50%; }
.brand-name { font-size: 24px; font-weight: 800; letter-spacing: .5px; }
.brand-tag { font-size: 13px; opacity: .92; }

/* ===== Tabs / panels ===== */
.tab-panel { display: none; flex: 1; overflow-y: auto; position: relative; }
.tab-panel.active { display: block; }
#tab-mapa.active { display: flex; flex-direction: column; overflow: hidden; }

.tabbar {
  display: flex; flex-shrink: 0;
  background: var(--blanco);
  border-top: 2px solid var(--borde);
  padding-bottom: env(safe-area-inset-bottom);
}
.tab {
  flex: 1; min-height: 62px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  background: none; border: none;
  font-size: 13px; font-weight: 600; color: var(--gris);
  cursor: pointer;
}
.tab-ico { font-size: 24px; }
.tab.active { color: var(--verde); border-top: 3px solid var(--naranja); margin-top: -2px; }

/* ===== Mapa ===== */
#map { flex: 1; min-height: 200px; }
.filter-bar {
  display: flex; gap: 8px; padding: 10px 12px;
  overflow-x: auto; background: var(--crema);
  flex-shrink: 0; -webkit-overflow-scrolling: touch;
}
.chip {
  flex-shrink: 0; padding: 10px 16px; min-height: 44px;
  border: 2px solid var(--borde); border-radius: 24px;
  background: var(--blanco); font-size: 15px; font-weight: 600; color: var(--texto);
  cursor: pointer;
}
.chip.active { background: var(--verde); border-color: var(--verde); color: var(--blanco); }

/* Marcadores */
.marker {
  width: 38px; height: 38px; border-radius: 50% 50% 50% 4px;
  transform: rotate(-45deg);
  display: flex; align-items: center; justify-content: center;
  border: 3px solid var(--blanco);
  box-shadow: 0 2px 8px rgba(0,0,0,.35);
  cursor: pointer; font-size: 17px;
}
.marker span { transform: rotate(45deg); }

/* ===== Sheets ===== */
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 30;
  background: var(--blanco);
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -6px 24px rgba(0,0,0,.25);
  max-height: 72%; display: flex; flex-direction: column;
}
.sheet[hidden] { display: none; }
.sheet-handle { width: 44px; height: 5px; border-radius: 3px; background: var(--borde); margin: 10px auto 4px; flex-shrink: 0; }
.sheet-content { overflow-y: auto; padding: 8px 18px 24px; }
.sheet-close {
  background: var(--crema); border: none; border-radius: 50%;
  width: 40px; height: 40px; font-size: 17px; cursor: pointer;
}

.point-title { font-size: 21px; font-weight: 800; margin-bottom: 2px; }
.point-type { display: inline-block; padding: 4px 12px; border-radius: 14px; font-size: 14px; font-weight: 700; color: var(--blanco); margin: 4px 0 8px; }
.stars { color: #F5A623; font-size: 18px; letter-spacing: 1px; }
.point-meta { color: var(--gris); font-size: 15px; margin: 2px 0; }
.tag-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.tag { background: var(--crema); border: 1px solid var(--borde); border-radius: 14px; padding: 6px 12px; font-size: 14px; }
.review { background: var(--crema); border-radius: var(--radio); padding: 12px; margin: 8px 0; font-size: 15px; }
.review .who { font-weight: 700; }
.review .when { color: var(--gris); font-size: 13px; }
.point-actions { display: flex; gap: 10px; margin-top: 14px; }
.point-actions a, .point-actions button {
  flex: 1; min-height: 52px;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  border-radius: var(--radio); font-size: 16px; font-weight: 700;
  text-decoration: none; cursor: pointer;
}
.act-go { background: var(--verde); color: var(--blanco); border: none; }
.act-save { background: var(--blanco); color: var(--verde); border: 2px solid var(--verde); }
.act-gmaps {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 50px; margin-top: 10px;
  border: 2px solid var(--borde); border-radius: var(--radio);
  background: var(--blanco); color: var(--texto);
  font-size: 15px; font-weight: 700; text-decoration: none;
}
.g-logo {
  width: 24px; height: 24px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: conic-gradient(#EA4335 0 25%, #FBBC05 25% 50%, #34A853 50% 75%, #4285F4 75% 100%);
  color: var(--blanco); font-size: 13px; font-weight: 800;
}

/* ===== Chat ===== */
.chat-sheet { height: 66%; }
.chat-head { display: flex; align-items: center; justify-content: space-between; padding: 6px 18px 10px; font-size: 18px; flex-shrink: 0; }
.chat-log { flex: 1; overflow-y: auto; padding: 0 18px; display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 85%; padding: 12px 14px; border-radius: 16px; font-size: 16px; line-height: 1.45; }
.msg.bot { background: var(--crema); border: 1px solid var(--borde); align-self: flex-start; border-bottom-left-radius: 4px; }
.msg.user { background: var(--verde); color: var(--blanco); align-self: flex-end; border-bottom-right-radius: 4px; }
.chat-input-row { display: flex; gap: 8px; padding: 12px 18px calc(env(safe-area-inset-bottom) + 14px); flex-shrink: 0; }
.chat-input-row input {
  flex: 1; min-height: 52px; padding: 0 16px;
  border: 2px solid var(--borde); border-radius: var(--radio); font-size: 16px;
}
.chat-input-row button {
  min-height: 52px; padding: 0 20px;
  background: var(--naranja); color: var(--blanco);
  border: none; border-radius: var(--radio); font-size: 16px; font-weight: 700; cursor: pointer;
}

/* ===== Formularios ===== */
.form-body { padding: 4px 18px calc(env(safe-area-inset-bottom) + 20px); overflow-y: auto; }
label { display: block; font-weight: 600; font-size: 15px; margin: 12px 0 4px; }
input[type="text"], input[type="number"], select, textarea {
  width: 100%; min-height: 52px; padding: 12px 14px; margin-top: 6px;
  border: 2px solid var(--borde); border-radius: var(--radio);
  font-size: 16px; background: var(--blanco); color: var(--texto);
  font-family: inherit;
}
textarea { min-height: 80px; resize: vertical; }
.btn-primary, .btn-secondary, .btn-whatsapp {
  width: 100%; min-height: 56px; margin-top: 16px;
  border-radius: var(--radio); font-size: 17px; font-weight: 700; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-primary { background: var(--verde); color: var(--blanco); border: none; }
.btn-secondary { background: var(--blanco); color: var(--verde); border: 2px solid var(--verde); }
.btn-whatsapp { background: #25D366; color: var(--blanco); border: none; }
.hint { color: var(--gris); font-size: 14px; margin-top: 10px; line-height: 1.4; }
.hint.center { text-align: center; margin: 24px 0; }

/* ===== Secciones ===== */
.section { padding: 18px 16px 90px; max-width: 640px; margin: 0 auto; }
.section h2 { font-size: 24px; margin-bottom: 4px; }
.section h3 { font-size: 18px; margin: 22px 0 10px; }
.section-sub { color: var(--gris); font-size: 15px; margin-bottom: 14px; }
.card {
  background: var(--blanco); border: 1px solid var(--borde);
  border-radius: var(--radio); padding: 16px; margin-bottom: 12px;
}

/* Viaje */
.trip-card { background: var(--blanco); border: 1px solid var(--borde); border-radius: var(--radio); padding: 18px; margin: 14px 0; }
.trip-title { font-size: 19px; font-weight: 800; }
.trip-sub { color: var(--gris); font-size: 15px; margin: 4px 0 12px; }
.privacy-row { display: flex; flex-direction: column; gap: 4px; font-size: 15px; font-weight: 600; }
.timeline-h { margin-top: 26px; }
.timeline { border-left: 3px solid var(--verde); margin-left: 10px; padding-left: 18px; }
.tl-item { position: relative; padding: 4px 0 22px; }
.tl-item::before {
  content: ""; position: absolute; left: -28.5px; top: 8px;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--verde); border: 3px solid var(--crema);
}
.tl-item.future::before { background: var(--blanco); border: 3px solid var(--naranja); }
.tl-date { font-size: 13px; font-weight: 700; color: var(--naranja); text-transform: uppercase; }
.tl-title { font-size: 17px; font-weight: 700; margin: 2px 0; }
.tl-note { color: var(--gris); font-size: 15px; line-height: 1.4; }
.tl-photos { display: flex; gap: 6px; margin-top: 8px; }
.tl-photo { width: 64px; height: 64px; border-radius: 10px; background: var(--borde); display: flex; align-items: center; justify-content: center; font-size: 26px; }

/* Beneficios */
.combo-card {
  background: #FFF3EA; border: 2px solid var(--naranja);
  border-radius: var(--radio); padding: 16px; margin-bottom: 8px;
  font-size: 15px; line-height: 1.5;
}
.combo-badge { font-weight: 800; color: var(--naranja); margin-bottom: 6px; }
.benefit {
  display: flex; align-items: center; gap: 12px;
  background: var(--blanco); border: 1px solid var(--borde);
  border-radius: var(--radio); padding: 14px; margin-bottom: 10px;
}
.benefit-logo {
  width: 48px; height: 48px; border-radius: 12px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; color: var(--blanco); font-size: 15px;
}
.benefit-name { font-weight: 700; }
.benefit-desc { color: var(--gris); font-size: 14px; line-height: 1.35; }
.benefit-off { margin-left: auto; font-weight: 800; color: var(--verde); font-size: 18px; flex-shrink: 0; }

/* Juntadas */
.meetup { background: var(--blanco); border: 1px solid var(--borde); border-radius: var(--radio); padding: 16px; margin-bottom: 12px; }
.meetup-date { color: var(--naranja); font-weight: 800; font-size: 14px; text-transform: uppercase; }
.meetup-title { font-size: 18px; font-weight: 800; margin: 4px 0; }
.meetup-place { color: var(--gris); font-size: 15px; }
.meetup-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; gap: 10px; }
.meetup-count { font-size: 14px; color: var(--gris); }
.btn-rsvp { min-height: 48px; padding: 0 18px; border-radius: var(--radio); border: none; background: var(--verde); color: var(--blanco); font-size: 15px; font-weight: 700; cursor: pointer; }
.btn-rsvp.going { background: var(--blanco); color: var(--verde); border: 2px solid var(--verde); }

/* Perfil */
.profile-card { display: flex; gap: 14px; align-items: center; background: var(--blanco); border: 1px solid var(--borde); border-radius: var(--radio); padding: 16px; margin: 14px 0; }
.avatar { width: 62px; height: 62px; border-radius: 50%; background: var(--naranja); color: var(--blanco); font-size: 28px; font-weight: 800; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.profile-name { font-size: 20px; font-weight: 800; }
.badge-confiable { display: inline-block; background: #E8F5EC; color: var(--verde); font-weight: 700; font-size: 14px; border-radius: 14px; padding: 4px 10px; margin: 6px 0; }
.profile-progress { height: 10px; background: var(--borde); border-radius: 5px; overflow: hidden; }
.profile-progress-fill { height: 100%; background: var(--verde); border-radius: 5px; }
.row-label { display: flex; align-items: center; justify-content: space-between; min-height: 44px; margin: 0; font-size: 16px; }
.row-label input[type="checkbox"] { width: 28px; height: 28px; accent-color: var(--verde); }
.maint-item { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--borde); font-size: 15px; }
.maint-item:last-child { border-bottom: none; }
.maint-due { font-weight: 700; color: var(--naranja); }
.maint-ok { font-weight: 700; color: var(--verde); }

/* Toast */
.toast {
  position: fixed; bottom: 100px; left: 50%; transform: translateX(-50%);
  background: var(--texto); color: var(--blanco);
  padding: 14px 22px; border-radius: 28px; font-size: 15px; font-weight: 600;
  z-index: 99; box-shadow: 0 4px 14px rgba(0,0,0,.3);
  max-width: 88%; text-align: center;
}

/* ===== v8: auth, reseñas y viajes ===== */
.auth-card p { margin-bottom: 10px; line-height: 1.4; }
.btn-google {
  width: 100%; min-height: 54px; margin-top: 8px;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  border: 2px solid var(--borde); border-radius: var(--radio);
  background: var(--blanco); color: var(--texto);
  font-size: 16px; font-weight: 700; cursor: pointer;
}
.badge-admin {
  display: inline-block; background: #FFF3EA; color: var(--naranja);
  font-weight: 700; font-size: 14px; border-radius: 14px; padding: 4px 10px;
  text-decoration: none; margin-top: 4px;
}
.resena-form { margin: 14px 0; padding: 12px; background: var(--crema); border-radius: var(--radio); }
.star-picker { display: flex; gap: 4px; margin: 8px 0; }
.star-picker button {
  width: 44px; height: 44px; font-size: 26px; color: #F5A623;
  background: none; border: none; cursor: pointer;
}
.trip-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.trip-actions .btn-secondary { width: auto; flex: 1; min-height: 46px; margin-top: 0; }
.btn-borrar {
  min-height: 46px; padding: 0 14px; border-radius: var(--radio);
  border: 2px solid #FECACA; background: var(--blanco); color: #DC2626;
  font-size: 15px; font-weight: 700; cursor: pointer;
}
.tl-borrar {
  margin-top: 6px; background: none; border: none; color: var(--gris);
  font-size: 13px; text-decoration: underline; cursor: pointer; padding: 4px 0;
}

/* ===== Agenda 2.0 ===== */
.fila2 { display: flex; gap: 10px; }
.fila2 label { flex: 1; }
.lugar-fila { display: flex; gap: 8px; margin-top: 6px; }
.lugar-fila input { flex: 1; margin-top: 0; }
.lugar-fila select { width: 70px; margin-top: 0; }
.btn-buscar {
  min-width: 52px; min-height: 52px; border-radius: var(--radio);
  border: 2px solid var(--verde); background: var(--blanco); color: var(--verde);
  font-size: 18px; font-weight: 700; cursor: pointer; flex-shrink: 0;
}
.lugar-res { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.lugar-op {
  text-align: left; padding: 10px 12px; min-height: 44px;
  border: 1px solid var(--borde); border-radius: 10px; background: var(--crema);
  font-size: 14px; cursor: pointer;
}
.trip-tot { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.tot-chip {
  background: var(--crema); border: 1px solid var(--borde); border-radius: 14px;
  padding: 6px 12px; font-size: 14px; font-weight: 700;
}
.tl-conector {
  margin: 0 0 0 4px; padding: 4px 0 12px; color: var(--naranja);
  font-size: 14px; font-weight: 700;
}
.chk-item {
  display: flex; align-items: center; gap: 10px; min-height: 46px;
  font-size: 16px; font-weight: 400; margin: 0; border-bottom: 1px solid var(--borde);
}
.chk-item:last-of-type { border-bottom: none; }
.chk-item input[type="checkbox"] { width: 26px; height: 26px; accent-color: var(--verde); flex-shrink: 0; }
.chk-item .tl-borrar { margin-left: auto; }
.chk-ok { text-decoration: line-through; color: var(--gris); }
.stats-grid { display: flex; gap: 10px; margin: 12px 0; }
.stat { flex: 1; text-align: center; background: var(--crema); border-radius: var(--radio); padding: 12px 6px; }
.stat-n { font-size: 22px; font-weight: 800; color: var(--verde); }
.stat-l { font-size: 12px; color: var(--gris); line-height: 1.25; margin-top: 2px; }

/* ===== v13: carnet de socio ===== */
.carnet { background:linear-gradient(135deg, #007A33, #004D20); color:#fff; border-radius:16px; padding:18px; margin:12px 0; box-shadow:0 4px 14px rgba(0,0,0,.18); }
.carnet-gold { background:linear-gradient(135deg, #C9971C, #7a5a08); }
.carnet-top { display:flex; justify-content:space-between; align-items:center; }
.carnet-logo { font-weight:800; letter-spacing:2px; font-size:16px; }
.carnet-nivel { font-size:12px; font-weight:800; background:rgba(255,255,255,.22); padding:4px 10px; border-radius:12px; letter-spacing:1px; }
.carnet-nombre { font-size:22px; font-weight:800; margin:16px 0 12px; }
.carnet-datos { display:flex; gap:28px; }
.carnet-datos > div { display:flex; flex-direction:column; }
.carnet-l { font-size:11px; opacity:.78; text-transform:uppercase; letter-spacing:1px; }
.carnet-v { font-size:15px; font-weight:700; font-variant-numeric:tabular-nums; }
.carnet-pie { margin-top:14px; font-size:12px; opacity:.88; }
.desc-validado { background:#E8F5EC; color:#00602a; border-radius:10px; padding:10px 12px; font-size:14px; }

/* ===== v14: boton ubicacion + invitacion chat ===== */
#btnMiUbicacion { position:absolute; bottom:14px; left:50%; transform:translateX(-50%); z-index:5; background:#FFFFFF; color:#007A33; border:2px solid #007A33; border-radius:26px; padding:12px 22px; font-size:17px; font-weight:800; box-shadow:0 3px 12px rgba(0,0,0,.25); cursor:pointer; white-space:nowrap; }
#btnMiUbicacion:active { background:#E8F5EC; }
.btn-chat-login { margin-top:8px; }

/* ===== v16: resultados del buscador del chat ===== */
.chat-res {
  display: flex; align-items: flex-start; gap: 10px; width: 100%;
  margin-top: 8px; padding: 10px 12px; text-align: left;
  background: var(--blanco); border: 1px solid var(--borde); border-radius: 12px;
  font: inherit; font-size: 15px; color: inherit; cursor: pointer;
}
.chat-res:active { background: #F3F4F6; }
.chat-res .cr-emoji { font-size: 20px; line-height: 1.2; }
.chat-res .cr-txt { flex: 1; min-width: 0; }
.chat-res .cr-sub { color: #6B7280; font-size: 13px; }
.chat-mapa {
  display: block; width: 100%; margin-top: 10px; padding: 10px;
  background: var(--verde); color: var(--blanco); border: 0; border-radius: 12px;
  font: inherit; font-size: 15px; font-weight: 600; cursor: pointer;
}

/* ===== v17: columna de acciones a la derecha del mapa ===== */
.acciones-mapa {
  position: absolute; right: 12px; bottom: 88px; z-index: 20;
  display: flex; flex-direction: column; align-items: flex-end; gap: 10px;
  pointer-events: none;
}
.acciones-mapa > button, #btnMiUbicacion {
  pointer-events: auto;
  display: inline-flex; align-items: center; gap: 7px;
  border: none; border-radius: 26px; padding: 12px 18px;
  font-size: 16px; font-weight: 700; line-height: 1;
  box-shadow: 0 4px 14px rgba(0,0,0,.25); cursor: pointer;
  white-space: nowrap; font-family: inherit;
}
.acc-preguntar { background: var(--naranja); color: var(--blanco); }
.acc-sumar { background: var(--verde); color: var(--blanco); }
.acc-sumar .acc-mas { font-size: 22px; font-weight: 700; margin-right: -2px; }
.acciones-mapa > button:active { filter: brightness(.92); }

/* el boton de ubicacion ahora vive en la misma columna */
#btnMiUbicacion {
  position: static; transform: none;
  background: #FFFFFF; color: #007A33; border: 2px solid #007A33; padding: 10px 16px;
}
#btnMiUbicacion:active { background: #E8F5EC; }

@media (max-width: 380px) {
  .acciones-mapa > button, #btnMiUbicacion { font-size: 15px; padding: 11px 15px; }
}

/* ===== v19: servicios por punto ===== */
.serv-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; align-items: center; }
.serv-chip {
  display: inline-block; padding: 4px 10px; border-radius: 999px;
  color: var(--blanco); font-size: 13px; font-weight: 700; white-space: nowrap;
}
.serv-add {
  padding: 4px 10px; border-radius: 999px; border: 1px dashed var(--verde);
  background: transparent; color: var(--verde); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer;
}
.serv-picker {
  margin-top: 10px; padding: 10px; border: 1px solid var(--borde);
  border-radius: 12px; background: var(--crema);
}
.serv-picker .hint { margin: 0 0 8px; }
.serv-opt {
  display: inline-block; margin: 0 6px 6px 0; padding: 8px 12px;
  border: 1px solid var(--borde); border-radius: 999px; background: var(--blanco);
  font: inherit; font-size: 14px; cursor: pointer;
}
.serv-opt:active { background: #F3F4F6; }
.serv-check { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; margin-top: 6px; }
.serv-check-item {
  display: flex; align-items: center; gap: 7px; margin: 0;
  font-size: 14px; font-weight: 500; cursor: pointer;
}
.serv-check-item input { width: 18px; height: 18px; margin: 0; flex-shrink: 0; }
.hint-inline { color: #6B7280; font-size: 13px; font-weight: 400; }
@media (max-width: 380px) { .serv-check { grid-template-columns: 1fr; } }

/* ===== v20: punto esperando aprobacion ===== */
.pendiente-aviso {
  display: inline-block; margin-top: 6px; padding: 5px 10px;
  border-radius: 999px; background: #FEF3C7; color: #92400E;
  font-size: 13px; font-weight: 700;
}
