  @font-face {
  font-family: 'Inter Tight';
  src: url('../fonts/InterTight-Light.woff2') format('woff2');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Inter Tight';
  src: url('../fonts/InterTight-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Inter Tight';
  src: url('../fonts/InterTight-SemiBold.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
  
  body {
  margin: 0;
  font-family: 'Inter Tight', Arial, sans-serif;
  display: flex;
  height: 100dvh;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

  #panel {
  touch-action: pan-y;
  overscroll-behavior: contain;  
  flex: 0 0 350px;  /* <- ancho fijo en escritorio */
  width: 350px;     /* <- redundante pero ayuda a estabilidad */
  max-width: 350px;
  scrollbar-gutter: stable;
  padding: 15px;
  overflow-y: auto;
  border-right: none;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: transform 0.3s ease;
  box-shadow: 10px 0 30px rgba(0,0,0,0.15);
}
.texto-small {
  font-size: 13px;
}
    #map {
      flex: 1;
      filter: contrast(1.05) saturate(1.1);
    }

    .item {
      cursor: pointer;
      margin-bottom: 10px;
      padding: 10px;
      background: rgba(255,255,255,0.6);
      backdrop-filter: blur(8px);
      border: 1px solid rgba(0,0,0,0.05);
      border-radius: 8px;
    }

    .item:hover {
      background: #f5f5f5;
    }

    .item.selected {
  background: rgba(12, 6, 68, 0.08);
  border: 1px solid rgba(12, 6, 68, 0.2);
  transform: translateX(4px);
}

    .foto {
      width: 100%;
      border-radius: 10px;
      margin-bottom: 10px;
    }

    .marker-halo {
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: background 0.25s ease;
    }

    .marker-number {
      color: white;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      font-weight: bold;
    }

    .leaflet-marker-icon {
      will-change: transform;
    }

    #menuBtn {
      position: fixed;
      top: 15px;
      left: 15px;
      z-index: 2000;
      background: #0c0644;
      color: #fff;
      border: none;
      padding: 8px;
      font-size: 16px;
      border-radius: 6px;
      display: none;
    }

    #installBtn {
      position: fixed;
      bottom: 60px;
      right: 10px;
      z-index: 3000;
      padding: 7px 7px;
      background: #0c0644;
      color: #fff;
      border: none;
      border-radius: 12px;
      display: none;
    }

    #update-banner {
  backdrop-filter: blur(10px);
  background: rgba(20,20,20,0.85);
}

#searchInput:focus {
  background: rgba(0,0,0,0.08);
}

#searchInput::placeholder {
  color: #999;
}

#splash {
  position: fixed;
  inset: 0;
  background: #0c0644;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

#splash.hidden {
  opacity: 0;
  visibility: hidden;
}

.splash-content {
  text-align: center;
  animation: fadeUp 1s ease;
}

.splash-content h1 {
  margin: 0;
  font-size: 28px;
  letter-spacing: 1px;
}

.splash-content p {
  opacity: 0.8;
  margin-top: 8px;
}

@keyframes fadeUp {
  from {
    transform: translateY(10px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Scrollbar moderna para el panel */
#panel {
  scrollbar-width: thin;              /* Firefox */
  scrollbar-color: rgba(165, 165, 165, 0.5) transparent;
}

/* Chrome / Edge / Safari */
#panel::-webkit-scrollbar {
  width: 8px;
}

#panel::-webkit-scrollbar-track {
  background: transparent;
}

#panel::-webkit-scrollbar-thumb {
  background: rgba(165, 165, 165, 0.5);
  border-radius: 0px;
  border: 2px solid transparent;
  background-clip: content-box;
}

#panel::-webkit-scrollbar-thumb:hover {
  background: rgba(12, 6, 68, 0.6);
}

    /* MOBILE PANEL */
    @media (max-width: 768px) {
      body { flex-direction: column; }

      #panel {
        position: fixed;
        top: 0;
        left: 0;
        width: 75%;
        height: 100%;
        z-index: 1500;
        transform: translateX(-100%);
        box-shadow: 2px 0 10px rgba(0,0,0,0.2);
        background: rgba(255, 255, 255, 0.82);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
      }

      #panel.open {
        transform: translateX(0);
      }

      #map {
        height: 100dvh;
        filter: contrast(1.05) saturate(1.1);
      }

     #menuBtn {
  display: block;
}

.menu-pill {
  position: fixed;
  left: 20px;
  bottom: 18px;
  top: auto;
  touch-action: manipulation;

  z-index: 3000;
  height: 36px;
  padding: 0 14px;

  border-radius: 40px;
  background: #0c0644;
  color: white;

  font-size: 14px;
  font-weight: 300;
}
    }

    button {
  border-radius: 10px;
  border: none;
  padding: 8px 10px;
  background: rgba(0,0,0,0.08);
  cursor: pointer;
  transition: 0.2s ease;
}

button:hover {
  background: rgba(0,0,0,0.15);
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 3px solid #d4af37;
  outline-offset: 2px;
}

button.active {
  background: #0c0644;
  color: white;
}

.botonvolver {
  margin-left: 0px;
}

@media (max-width: 768px) {
  .botonvolver {
    margin-left: 100px;
  }
}

@media (max-width: 768px) {
  #panel {
    height: 100dvh;
    overflow-y: auto;
    overscroll-behavior: contain;
    touch-action: pan-y;
  }
}

#update-banner {
  position: fixed;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 50px);
  max-width: 400px;

  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 10px;

  padding: 12px 14px;
  border-radius: 14px;

  background: rgba(20, 20, 20, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);

  color: #fff;
  font-size: 14px;

  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
  z-index: 9999;

  animation: slideDown 0.35s ease;
}

#update-banner span {
  flex: 1;
}

/* BOTÓN ACTUALIZAR */
#update-banner #update-btn {
  background: #0c0644;
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 8px;
  font-weight: 500;
  cursor: pointer;
}

#update-banner #update-btn:hover {
  background: #1a0f6e;
}

/* BOTÓN CERRAR */
#update-banner #dismiss-btn {
  background: transparent;
  color: #ccc;
  border: none;
  font-size: 16px;
  cursor: pointer;
}

#update-banner #dismiss-btn:hover {
  color: white;
}

/* ANIMACIÓN */
@keyframes slideDown {
  from {
    transform: translate(-50%, -20px);
    opacity: 0;
  }
  to {
    transform: translate(-50%, 0);
    opacity: 1;
  }
}

#lista {
  padding-bottom: calc(350px + env(safe-area-inset-bottom));
}

.btn-info {
  min-width: 44px;
  height: 36px;
  border-radius: 999px;
  border: none;

  background: rgba(12, 6, 68, 0.10);
  color: #0c0644;

  font-size: 14px;
  font-weight: 600;

  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.btn-info:hover {
  background: rgba(12, 6, 68, 0.18);
}

.btn-info:active {
  transform: scale(0.96);
}

.btn-fav {
  min-width: 38px;
  height: 36px;
  border-radius: 999px;
  border: none;

  background: rgba(184, 134, 11, 0.12);
  color: #b8860b;

  font-size: 18px;
  font-weight: 600;

  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.btn-fav:hover {
  background: rgba(184, 134, 11, 0.20);
}

.btn-fav.active {
  background: #b8860b;
  color: white;
}

.empty-state {
  padding: 18px 12px;
  border-radius: 12px;
  background: rgba(12, 6, 68, 0.06);
  color: #666;
  font-size: 14px;
  text-align: center;
}

.skyline-view {
  position: fixed;
  inset: 20px;
  z-index: 5000;

  display: none;
  flex-direction: column;
  gap: 14px;

  padding: 18px;
  border-radius: 18px;

  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);

  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.30);

  overflow: hidden;
  overscroll-behavior: none;
  touch-action: pan-x;
}

.skyline-view.open {
  display: flex;
}

.skyline-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.skyline-header h2 {
  margin: 0 0 4px;
  color: #0c0644;
}

.skyline-summary {
  color: #666;
  font-size: 13px;
}

.skyline-scroll {
  flex: 1;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-x;
  padding: 8px 4px 10px;
}

.skyline-bars {
  min-width: 1180px;
  height: 100%;
  display: flex;
  align-items: flex-end;
  gap: 5px;
  padding: 0 6px 124px;
  border-bottom: 2px solid rgba(12, 6, 68, 0.20);
  box-sizing: border-box;
}

.skyline-bar {
  width: 13px;
  min-width: 13px;
  border: none;
  border-radius: 6px 6px 0 0;
  cursor: pointer;
  padding: 0;
  position: relative;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.35);
  transition: transform 0.18s ease, filter 0.18s ease;
}

.skyline-bar:hover {
  transform: translateY(-5px);
  filter: brightness(1.08);
}

.skyline-bar::after {
  content: attr(data-label);
  position: absolute;
  left: 50%;
  top: calc(100% + 8px);
  transform: translateX(-50%);
  width: 14px;
  height: 108px;
  color: #555;
  font-size: 10px;
  line-height: 1;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  writing-mode: vertical-lr;
  text-orientation: mixed;
}

.skyline-year-gap {
  width: 54px;
  min-width: 54px;
  height: 100%;
  position: relative;
  border-bottom: 2px dotted rgba(12, 6, 68, 0.26);
}

.skyline-year-gap::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 1px;
  height: 42px;
  border-left: 1px dashed rgba(12, 6, 68, 0.28);
}

.skyline-year-gap::after {
  content: attr(data-label);
  position: absolute;
  left: 50%;
  bottom: 46px;
  transform: translateX(-50%);
  color: #777;
  font-size: 11px;
  white-space: nowrap;
}

.skyline-tooltip {
  position: absolute;
  left: 0;
  top: 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(12, 6, 68, 0.92);
  color: white;
  font-size: 13px;
  pointer-events: none;
  opacity: 0;
  transform: translate(14px, 14px);
  transition: opacity 0.18s ease, transform 0.18s ease;
  z-index: 2;
}

.skyline-tooltip.visible {
  opacity: 1;
  transform: translate(14px, 10px);
}

.skyline-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  font-size: 12px;
  color: #666;
}

.skyline-legend button,
.skyline-controls button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 999px;
  padding: 7px 10px;
  background: rgba(12, 6, 68, 0.07);
  color: #0c0644;
  font-size: 12px;
}

.skyline-legend i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.skyline-legend button.active,
.skyline-controls button.active {
  background: #0c0644;
  color: white;
}

.skyline-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
}

.skyline-control-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

@media (max-width: 768px) {
  .skyline-view {
    inset: 0;
    border-radius: 0;
    padding: 14px;
  }

  .skyline-header {
    align-items: center;
  }

  .skyline-header h2 {
    font-size: 20px;
  }

  .skyline-bars {
    min-width: 980px;
    gap: 4px;
  }

  .skyline-bar {
    width: 11px;
    min-width: 11px;
  }
}

.nombre-edificio {
  cursor: pointer;
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.stat-card {
  background: rgba(255,255,255,0.7);
  border-radius: 14px;
  padding: 14px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.08);
}

.stat-card strong {
  display: block;
  font-size: 22px;
  color: #0c0644;
  margin-bottom: 4px;
}

.stat-card span {
  font-size: 12px;
  color: #666;
}

.stats-section {
  margin-top: 22px;
  background: rgba(255,255,255,0.65);
  border-radius: 16px;
  padding: 14px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.08);
}

#stats {
  padding-bottom: 200px;
}

.stats-section h3 {
  margin-top: 0;
  margin-bottom: 12px;
  color: #0c0644;
}

.top-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.top-item {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border-radius: 12px;
  background: rgba(12, 6, 68, 0.06);
}

.top-item span {
  font-size: 12px;
  color: #666;
}

.top-item b {
  color: #0c0644;
  white-space: nowrap;
}

.record-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(0,0,0,0.08);
}

.record-item:last-child {
  border-bottom: none;
}

.record-item span {
  color: #666;
  font-size: 13px;
}

.record-item strong {
  color: #0c0644;
}

.range-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;

  padding: 10px 0;
  border-bottom: 1px solid rgba(0,0,0,0.08);
}

.range-item:last-child {
  border-bottom: none;
}

.range-item span {
  color: #666;
  font-size: 13px;
}

.range-item strong {
  min-width: 34px;
  height: 28px;
  border-radius: 999px;

  display: flex;
  align-items: center;
  justify-content: center;

  background: rgba(12, 6, 68, 0.10);
  color: #0c0644;
  font-size: 14px;
}

.chart-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.chart-tabs button {
  flex: 1;
  padding: 8px;
  border-radius: 999px;
  border: none;
  background: rgba(12, 6, 68, 0.08);
  color: #0c0644;
  font-weight: 600;
}

.chart-tabs button.active {
  background: #0c0644;
  color: white;
}

#shareBtn {
  position: fixed;
  display: flex;
align-items: center;
gap: 5px;
  bottom: 15px;
  right: 10px;
  z-index: 3000;
  padding: 7px 7px;
  background: #25D366;
  color: #fff;
  border: none;
  border-radius: 12px;
  display: block;
  font-weight: 300;
}

.hide-keyboard-btn {
  display: none;
}

@media (max-width: 768px) {
  .hide-keyboard-btn {
    display: block;
  }
}

.spacer-mobile {
  display: none;
}

@media (max-width: 768px) {
  .spacer-mobile {
    display: block;
    height: 35px;
  }
}
.random-btn {
  min-width: 44px;
  height: 44px;
  border-radius: 12px;

  display: flex;
  align-items: center;
  justify-content: center;

  background: rgba(0,0,0,0.06);
  color: #0c0644;

  font-size: 22px;
  padding: 0;
}

.random-btn:hover {
  background: rgba(0,0,0,0.12);
}

.support-btn {
  display: flex;
  align-items: center;
  justify-content: center;

  width: 90%;
  padding: 8px;

  border-radius: 14px;

  background: #ca910c;
  color: white;

  text-decoration: none;
  font-size: 16px;
  font-weight: 600;

  transition: 0.2s ease;
}

.support-btn:hover {
  background: #1a0f6e;
  transform: translateY(-1px);
}

.premium-modal{
  position:fixed;
  inset:0;
  z-index:10000;

  display:none;
  align-items:center;
  justify-content:center;

  background:rgba(0,0,0,.35);
  backdrop-filter:blur(6px);
  -webkit-backdrop-filter:blur(6px);
}

.premium-modal.open{
  display:flex;
}

.premium-card{
  position: relative;
  width:min(75vw,340px);

  padding:20px;
  border-radius:20px;

  background:rgba(255,255,255,.95);

  text-align:center;

  box-shadow:0 20px 60px rgba(0,0,0,.25);
}

.premium-icon{
  font-size:42px;
  margin-bottom:10px;
}

.message-subtext{
  font-size:13px;
  color:#767676;
  margin-top:8px;
}

.premium-actions{
  display:flex;
  gap:10px;
  margin-top:20px;
}

.premium-actions button{
  flex:1;
}

#premiumCloseBtn {
  position: absolute;
  top: 10px;
  right: 12px;

  padding: 0;
  border: none;
  background: transparent;

  font-size: 24px;
  color: #888;
  cursor: pointer;
}

#premiumCloseBtn:hover {
  color: #0c0644;
  background: transparent;
}

.control-tip {
  position: absolute;
  right: 55px;

  padding: 6px 10px;

  color: white;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;

  border-radius: 10px;

  background: rgba(12, 6, 68, 0.92);

  backdrop-filter: blur(10px);

  opacity: 0;

  transform: translateX(10px);

  animation: tipFade 4s ease forwards;

  pointer-events: none;
}

@keyframes tipFade {

  0% {
    opacity: 0;
    transform: translateX(10px);
  }

  10% {
    opacity: 1;
    transform: translateX(0);
  }

  80% {
    opacity: 1;
    transform: translateX(0);
  }

  100% {
    opacity: 0;
    transform: translateX(10px);
  }

}
