html, body { height: 100%; }
  body{
    margin:0;
    overflow:hidden;
    font-family: "Lexend", sans-serif, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial;
    background: radial-gradient(1200px 800px at 30% 20%, #6f6bff 0%, #4d49a5 50%, #3c3982 100%);
    color: #fff;
  }
      
  /* =========================
   TOP BAR / HEADER (FULL WIDTH + GRADIENT)
   ========================= */
#topbar{
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 84px; /* entre 60 y 100 */
  z-index: 12;
  pointer-events: none;

  /* gradiente violeta brand: 100% -> 0% */
  background: linear-gradient(
    to bottom,
    rgba(60, 57, 130, 1) 0%,
    rgba(60, 57, 130, 0) 100%
  );
}

#topbar h1{
  margin: 0;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;

  padding: 0 14px;
  color: #fff;
  font-size: 16px;
  font-weight: normal;
  letter-spacing: .35px;
  text-align: center;
  text-shadow: 0 8px 22px rgba(0,0,0,.35);
}


  #app { position:fixed; inset:0; }

  /* =========================
     WEATHER WIDGET (El Calafate)
     ========================= */
  #weatherWidget{
    position: fixed;
    top: 92px;
    right: 14px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(255,255,255,.14), rgba(255,255,255,.08));
    border: 1px solid rgba(255,255,255,.22);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 18px 60px rgba(0,0,0,.35);
    pointer-events: auto;
    cursor: pointer;
    user-select: none;
    transition: transform .1s ease, box-shadow .15s ease;
  }
  #weatherWidget:hover{
    transform: translateY(-1px);
    box-shadow: 0 22px 70px rgba(0,0,0,.45);
  }
  #weatherWidget:active{
    transform: translateY(1px);
  }
  #weatherWidget .w-icon{
    width: 26px;
    height: 26px;
    opacity: .95;
    flex: 0 0 auto;
    filter: drop-shadow(0 10px 22px rgba(0,0,0,.25));
  }
  #weatherWidget .w-temp{
    font-size: 14px;
    font-weight: 750;
    letter-spacing: .2px;
    line-height: 1;
    margin: 0;
  }
  #weatherWidget .w-loc{
    font-size: 11px;
    opacity: .75;
    line-height: 1.1;
    margin: 0;
  }
  #weatherWidget .w-stack{
    display:flex;
    flex-direction: column;
    gap: 2px;
  }

  /* =========================
     FORECAST PANEL (slides from top)
     ========================= */
  #forecast-panel {
    position: fixed;
    inset: 0;
    z-index: 9999;
    pointer-events: none;
    opacity: 0;
    transition: opacity .3s ease;
  }
  #forecast-panel.open {
    pointer-events: auto;
    opacity: 1;
  }
  .forecast-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.5);
  }
  .forecast-card {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    max-width: 480px;
    margin: 0 auto;
    background: linear-gradient(180deg, rgba(22,20,45,.96), rgba(16,14,35,.98));
    border: 1px solid rgba(140,130,255,.18);
    border-top: none;
    border-radius: 0 0 18px 18px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 12px 40px rgba(0,0,0,.5);
    transform: translateY(-100%);
    transition: transform .4s cubic-bezier(.22,1,.36,1);
    overflow: hidden;
  }
  #forecast-panel.open .forecast-card {
    transform: translateY(0);
  }
  .forecast-header {
    display: flex;
    align-items: center;
    padding: 16px 18px 12px;
    border-bottom: 1px solid rgba(140,130,255,.12);
  }
  .forecast-title {
    flex: 1;
    font-family: "Lexend", sans-serif;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    margin: 0;
  }
  .forecast-close {
    background: none;
    border: none;
    cursor: pointer;
    color: rgba(255,255,255,.45);
    padding: 4px;
    border-radius: 8px;
    display: flex;
    transition: color .15s;
  }
  .forecast-close:hover { color: rgba(255,255,255,.85); }
  .forecast-list {
    padding: 8px 0;
  }
  .forecast-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 18px;
    font-family: "Lexend", sans-serif;
    font-size: 13px;
    color: rgba(255,255,255,.85);
    transition: background .15s;
  }
  .forecast-row:hover {
    background: rgba(255,255,255,.04);
  }
  .forecast-row:first-child {
    color: #fff;
    font-weight: 600;
  }
  .forecast-day {
    width: 36px;
    flex: 0 0 auto;
    font-weight: 600;
  }
  .forecast-icon {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
  }
  .forecast-label {
    width: 72px;
    flex: 0 0 auto;
    font-size: 12px;
    opacity: .6;
  }
  .forecast-temps {
    flex: 1;
    text-align: right;
    font-size: 13px;
    white-space: nowrap;
  }
  .forecast-temps strong {
    color: #fff;
  }
  .forecast-detail {
    width: 64px;
    flex: 0 0 auto;
    font-size: 12px;
    text-align: right;
    opacity: .55;
  }

  @media (max-width: 720px) {
    .forecast-card {
      max-width: 100%;
      border-radius: 0 0 18px 18px;
    }
    .forecast-row {
      padding: 10px 14px;
      gap: 8px;
    }
    .forecast-label {
      display: none;
    }
  }

/* =========================
   GEO BUTTON (match Weather widget)
   ========================= */
#geoBtn{
  position: fixed;
  right: 14px;
  bottom: 16px;
  z-index: 9990;
  width: 56px;
  height: 56px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.22);
  background: linear-gradient(180deg, rgba(255,255,255,.14), rgba(255,255,255,.08));
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 18px 60px rgba(0,0,0,.35);
  cursor: pointer;
  display: grid;
  place-items: center;
  color: #fff;
  user-select: none;
  transition: background .2s ease, border-color .2s ease, box-shadow .2s ease, transform .08s ease;
}
#geoBtn:hover{
  background: linear-gradient(180deg, rgba(255,255,255,.18), rgba(255,255,255,.10));
}
#geoBtn:active{
  transform: translateY(1px);
}
#geoBtn svg{
  filter: drop-shadow(0 10px 22px rgba(0,0,0,.25));
}

/* Active = Google Maps-ish blue */
#geoBtn.is-active{
  background: linear-gradient(180deg, rgba(66,133,244,.95), rgba(48,110,226,.95));
  border-color: rgba(66,133,244,.9);
  box-shadow: 0 18px 60px rgba(0,0,0,.35), 0 0 0 3px rgba(66,133,244,.25);
}


  #hud {
    position: fixed;
    top: 92px;
    left: 14px;
    width: min(360px, calc(100vw - 28px));
    pointer-events: auto;
    background: linear-gradient(180deg, rgba(255,255,255,.14), rgba(255,255,255,.08));
    border: 1px solid rgba(255,255,255,.22);
    border-radius: 16px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 18px 60px rgba(0,0,0,.35);
    overflow: hidden;
  }
  #hud header{
    padding: 12px 14px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap: 10px;
    border-bottom: 1px solid rgba(255,255,255,.12);
  }
  #hud h1{
    font-size: 14px;
    margin:0;
    letter-spacing:.2px;
    font-weight: 650;
    opacity:.95;
  }
  #hud .small{
    font-size: 12px;
    opacity:.7;
    line-height: 1.25;
  }
  #hud .content{
    padding: 12px 14px 14px;
    display: grid;
    gap: 12px;
  }
  .row{ display:flex; gap:10px; align-items:center; flex-wrap:wrap; }
  .btn{
    appearance:none;
    border: 1px solid rgba(255,255,255,.22);
    background: rgba(255,255,255,.10);
    color:#fff;
    padding: 8px 10px;
    border-radius: 12px;
    font-size: 13px;
    cursor:pointer;
    user-select:none;
    transition: transform .06s ease, background .15s ease, border-color .15s ease, opacity .15s ease;
  }
  .btn:hover{ background: rgba(255,255,255,.14); }
  .btn:active{ transform: translateY(1px); }
  .btn.active{
    background: rgba(255,255,255,.22);
    border-color: rgba(255,255,255,.35);
  }

  .route-list{ display:grid; gap: 8px; padding-bottom: 6px; }
  .route-card{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap: 10px;
    padding: 10px 10px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,.18);
    background: rgba(0,0,0,.16);
    cursor:pointer;
    transition: background .15s ease, border-color .15s ease;
  }
  .route-card:hover{ background: rgba(0,0,0,.22); }
  .route-card.active{
    background: rgba(255,255,255,.10);
    border-color: rgba(255,255,255,.36);
  }

  /* Evita recortes cuando la card expande (detalle + contexto) */
  .route-card.active{ align-items: flex-start; }
  .route-card.active .left{ align-items: flex-start; }
  .route-card.active .swatch{ margin-top: 2px; }

  .route-meta-details,
  .route-meta-context{
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    line-height: 1.25;
  }
  .left{
    display:flex;
    align-items:center;
    gap: 10px;
    min-width: 0;
  }
  .swatch{
    width: 10px;
    height: 34px;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,.25);
    flex: 0 0 auto;
  }
  .label{
    display:flex;
    flex-direction:column;
    gap: 2px;
    min-width: 0;
  }
  .name{
    font-size: 14px;
    font-weight: 650;
    margin:0;
    white-space: nowrap;
    overflow:hidden;
    text-overflow: ellipsis;
  }
  .meta{
    font-size: 12px;
    opacity:.7;
    margin:0;
    white-space: nowrap;
    overflow:hidden;
    text-overflow: ellipsis;
  }

  /* En card activa, permitimos que las líneas extra hagan wrap (sin ellipsis) */
  .route-card.active .meta{
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
  }
  .route-toggle {
    flex: 0 0 auto;
    background: none;
    border: none;
    cursor: pointer;
    color: rgba(255,255,255,.5);
    padding: 4px;
    border-radius: 6px;
    transition: color .15s;
  }
  .route-toggle:hover {
    color: rgba(255,255,255,.85);
  }
  .route-card.active .route-toggle {
    color: rgba(255,255,255,.9);
  }

  .pill{
    font-size: 11px;
    padding: 6px 8px;
    border-radius: 999px;
    background: rgba(255,255,255,.12);
    border: 1px solid rgba(255,255,255,.18);
    opacity:.9;
    flex: 0 0 auto;
  }

  #legend{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap: 10px;
    font-size: 12px;
    opacity:.75;
    border-top: 1px solid rgba(255,255,255,.12);
    padding-top: 10px;
  }

  #loading {
    position: fixed;
    inset: 0;
    display:flex;
    align-items:center;
    justify-content:center;
    pointer-events:none;
  }
  .loading-card{
    pointer-events:none;
    width: min(520px, calc(100vw - 28px));
    background: rgba(255,255,255,.10);
    border: 1px solid rgba(255,255,255,.20);
    border-radius: 18px;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 18px 60px rgba(0,0,0,.35);
    padding: 14px 16px;
    display:flex;
    gap: 12px;
    align-items:center;
  }
  .spinner{
    width: 18px; height: 18px;
    border-radius: 999px;
    border: 2px solid rgba(255,255,255,.25);
    border-top-color: rgba(255,255,255,.95);
    animation: spin 0.9s linear infinite;
    flex: 0 0 auto;
  }
  @keyframes spin { to { transform: rotate(360deg); } }

  .loading-text{ display:flex; flex-direction:column; gap: 2px; }
  .loading-title{ font-size: 13px; font-weight: 700; margin:0; }
  .loading-sub{ font-size: 12px; opacity:.75; margin:0; }

  /* Connectivity indicator */
  #conn-status {
    position: fixed;
    top: 12px;
    left: 50%;
    transform: translateX(-50%) translateY(-60px);
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 12px;
    font-family: "Lexend", sans-serif;
    font-size: 12px;
    font-weight: 600;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 4px 20px rgba(0,0,0,.3);
    transition: transform .4s cubic-bezier(.22,1,.36,1), opacity .4s;
    pointer-events: none;
  }
  #conn-status.visible {
    transform: translateX(-50%) translateY(0);
  }
  #conn-status.offline {
    background: rgba(255,60,60,.2);
    border: 1px solid rgba(255,60,60,.35);
    color: #ff9b9b;
  }
  #conn-status.online {
    background: rgba(60,200,120,.2);
    border: 1px solid rgba(60,200,120,.35);
    color: #7dffaa;
  }
  #conn-status .conn-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex: 0 0 auto;
  }
  #conn-status.offline .conn-dot { background: #ff5c5c; }
  #conn-status.online .conn-dot { background: #3cc878; }

  #corner-note{
    position:fixed;
    bottom: 12px;
    left: 12px;
    font-size: 12px;
    opacity:.6;
    pointer-events:none;
    max-width: min(520px, calc(100vw - 24px));
  }
  code{
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 11px;
    opacity:.9;
  }

  /* =========================
     MOBILE: UI abajo, mapa arriba
     ========================= */
  @media (max-width: 720px) {
    @media (max-width: 720px) {
  #weatherWidget{
    top: 92px; /* separa del header, deja aire */
      left:14px;
      right:auto;
  }
}


      
      #hud{
      top: auto;
      bottom: 12px;
      left: 12px;
      right: 12px;
      width: auto;
      max-height: 46vh;      /* UI ocupa ~mitad inferior */
      border-radius: 18px;
    }

    #hud header{
      padding: 10px 12px;
    }
    #hud .content{
      padding: 10px 12px 12px;
      gap: 10px;
    }

    .route-list{
      max-height: 30vh;      /* deja respirar cards expandidas */
      overflow: auto;
      padding-right: 4px;
      padding-bottom: 6px;
    }

    #legend{
      font-size: 11px;
    }

    #corner-note{
      display:none;          /* en mobile molesta */
    }

    /* Geolocation button: positioned via JS in pasarelas-glaciar.html */
    #geoBtn{
      right: 16px !important;
    }
  }

/* =========================
   POI DETAIL MODAL
   ========================= */
#poi-detail-overlay {
  position: fixed;
  inset: 0;
  z-index: 10001;
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity .25s ease;
}
#poi-detail-overlay.open {
  display: flex;
  opacity: 1;
}
.poi-detail-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .55);
}
.poi-detail-card {
  position: relative;
  width: 100%;
  max-width: 700px;
  max-height: 90vh;
  margin: 0 20px;
  background: linear-gradient(180deg, rgba(22, 20, 48, .97), rgba(14, 12, 32, .99));
  border: 1px solid rgba(140, 130, 255, .18);
  border-radius: 20px;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  box-shadow: 0 24px 80px rgba(0, 0, 0, .6);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: translateY(24px) scale(.97);
  transition: transform .3s cubic-bezier(.22, 1, .36, 1);
}
#poi-detail-overlay.open .poi-detail-card {
  transform: translateY(0) scale(1);
}

/* Close button */
.poi-detail-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, .15);
  background: rgba(0, 0, 0, .35);
  backdrop-filter: blur(8px);
  color: rgba(255, 255, 255, .8);
  font-size: 18px;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background .15s, color .15s;
}
.poi-detail-close:hover {
  background: rgba(255, 255, 255, .12);
  color: #fff;
}

/* Hero photo */
.poi-detail-hero {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
  flex-shrink: 0;
}
.poi-detail-hero-placeholder {
  width: 100%;
  height: 120px;
  background: linear-gradient(135deg, rgba(100, 90, 200, .25), rgba(60, 50, 140, .25));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  flex-shrink: 0;
}

/* Scrollable body */
.poi-detail-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Type badge */
.poi-detail-type {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: rgba(180, 170, 255, .9);
  padding: 5px 10px;
  border-radius: 8px;
  background: rgba(140, 130, 255, .12);
  border: 1px solid rgba(140, 130, 255, .15);
  align-self: flex-start;
}

/* Title */
.poi-detail-title {
  font-size: 22px;
  font-weight: 750;
  margin: 0;
  color: #fff;
  line-height: 1.2;
}

/* Description */
.poi-detail-description {
  font-size: 14px;
  line-height: 1.6;
  color: rgba(255, 255, 255, .82);
  margin: 0;
  white-space: pre-line;
}

/* Info sections (tips, accessibility) */
.poi-detail-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.poi-detail-section-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: rgba(255, 255, 255, .5);
  margin: 0;
}
.poi-detail-section-text {
  font-size: 13px;
  line-height: 1.5;
  color: rgba(255, 255, 255, .75);
  margin: 0;
  white-space: pre-line;
}

/* Audio guide button */
.poi-detail-audio {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid rgba(140, 130, 255, .22);
  background: rgba(140, 130, 255, .1);
  color: rgba(200, 190, 255, .95);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
  text-decoration: none;
  align-self: flex-start;
}
.poi-detail-audio:hover {
  background: rgba(140, 130, 255, .2);
}

/* Photo gallery */
.poi-detail-gallery {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.poi-detail-gallery img {
  height: 120px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, .08);
}

/* Route tags */
.poi-detail-routes {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.poi-detail-route-tag {
  font-size: 11px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .12);
  color: rgba(255, 255, 255, .75);
  font-weight: 600;
}

/* Mobile: near full-screen */
@media (max-width: 720px) {
  .poi-detail-card {
    margin: 8px;
    max-height: calc(100vh - 16px);
    border-radius: 18px;
  }
  .poi-detail-hero {
    height: 180px;
  }
  .poi-detail-body {
    padding: 16px 18px 20px;
  }
  .poi-detail-title {
    font-size: 20px;
  }
}
