/* Map-first home inside CTH shell — hero map fills viewport */
body.cth-map-first-active {
  overflow: hidden;
  height: 100vh;
}
body.cth-map-first-active .flowline,
body.cth-map-first-active .engnav,
body.cth-map-first-active .rulebar {
  display: none !important;
}
body.cth-map-first-active .envbar {
  border-bottom: 1px solid var(--line);
}
body.cth-map-first-active .envs {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  padding: 4px 0 6px;
}
body.cth-map-first-active .envtab span.rl,
body.cth-map-first-active .envtab .acc {
  display: none;
}
body.cth-map-first-active .envtab {
  padding: 4px 8px;
}
body.cth-map-first-active .envtab b {
  font-size: 11px;
}
body.cth-map-first-active main {
  padding: 0;
  height: calc(100vh - 96px);
  max-height: calc(100vh - 96px);
}
body.cth-map-first-active main .wrap {
  max-width: none;
  padding: 0;
  height: 100%;
}
body.cth-map-first-active #view {
  height: 100%;
}
body.cth-map-first-active footer.rule {
  display: none;
}
.dl-map-first {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  background: #243b53;
}
.dl-map-first .mfh-main {
  flex: 1 1 auto;
  min-height: 0;
  position: relative;
  display: flex;
  flex-direction: column;
}
.dl-map-first .mfh-map-wrap {
  flex: 1 1 auto;
  min-height: 0;
  background: #1a3a52;
}
#map-first-map {
  width: 100%;
  height: 100%;
  min-height: 0;
  background: #243b53;
}
.dl-map-first .map-hint {
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 450;
  max-width: min(340px, 92vw);
  font-size: 10px;
  line-height: 1.4;
  margin: 0;
  padding: 8px 10px;
  background: #fff;
  border: 2px solid var(--cyan);
  border-radius: 10px;
  color: var(--deep);
  box-shadow: 0 4px 12px #06284744;
}
.dl-map-first .mfh-foot {
  flex: 0 0 auto;
  padding: 6px 10px 8px;
  background: #fff;
  border-top: 2px solid var(--cyan);
}
.dl-map-first .meth-slot .methodology-footnote {
  margin: 0;
  padding: 8px 12px;
  border: 0;
  border-radius: 0;
  font-size: 10px;
  line-height: 1.35;
  color: var(--deep);
  background: transparent;
}
.dl-map-first .meth-slot .methodology-footnote a {
  color: var(--fg);
  font-weight: 700;
}
.dl-map-first .meth-desktop {
  display: block;
}
.dl-map-first .meth-mobile {
  display: none;
}
.dl-map-first .meth-mobile summary {
  list-style: none;
  cursor: pointer;
  padding: 8px 12px;
  border: 2px solid var(--cyan);
  border-radius: 10px;
  background: #fff;
  color: var(--deep);
  font-size: 11px;
  font-weight: 700;
}
.dl-map-first .meth-mobile summary::-webkit-details-marker {
  display: none;
}
.dl-map-first .detail-panel {
  position: absolute;
  bottom: 52px;
  left: 12px;
  width: min(320px, calc(100vw - 24px));
  max-height: min(420px, calc(100% - 80px));
  z-index: 460;
  background: #fff;
  border: 3px solid var(--fg);
  border-radius: 14px;
  font-size: 11px;
  color: var(--deep);
  box-shadow: 0 8px 24px #06284766;
  display: none;
  flex-direction: column;
  overflow: hidden;
}
.dl-map-first .detail-panel.open {
  display: flex;
}
.dl-map-first .detail-panel .panel-head {
  flex: 0 0 auto;
  padding: 12px 14px 8px;
  border-bottom: 1px solid var(--cyan);
  position: relative;
}
.dl-map-first .detail-panel .panel-body {
  flex: 1 1 auto;
  overflow: auto;
  padding: 10px 14px 14px;
}
.dl-map-first .detail-panel h2 {
  font-size: 13px;
  font-weight: 700;
  margin: 0 0 4px;
  padding-right: 64px;
  text-transform: none;
}
.dl-map-first .detail-panel h2::after {
  content: "";
  display: block;
  width: 48px;
  height: 3px;
  background: var(--lg);
  margin-top: 6px;
  border-radius: 2px;
}
.dl-map-first .detail-panel .site-line {
  font-size: 10px;
  color: #4a6f8f;
  margin: 0;
  overflow-wrap: anywhere;
  line-height: 1.35;
}
.dl-map-first .detail-panel table {
  width: 100%;
  border-collapse: collapse;
  font-size: 10px;
}
.dl-map-first .detail-panel td {
  border-top: 1px solid var(--cyan);
  padding: 6px 0;
  vertical-align: top;
}
.dl-map-first .detail-panel td:first-child {
  font-weight: 600;
  width: 44%;
}
.dl-map-first .detail-panel .yr {
  color: var(--fg);
  font-size: 9px;
}
.dl-map-first .detail-panel .meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin-top: 10px;
  font-size: 10px;
  font-weight: 700;
}
.dl-map-first .detail-panel .gap {
  margin-top: 10px;
  padding: 10px;
  border: 2px solid var(--fg);
  border-radius: 10px;
  background: #f8fff4;
  line-height: 1.4;
  overflow-wrap: anywhere;
  word-break: normal;
}
.dl-map-first .detail-panel .gap b {
  display: block;
  margin-bottom: 4px;
}
.dl-map-first .detail-panel .gap-meta {
  font-size: 9px;
  color: #4a6f8f;
  font-weight: 600;
}
.dl-map-first .detail-panel .close-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 10px;
  font-weight: 700;
  border: 2px solid var(--sky);
  background: #fff;
  color: var(--deep);
  border-radius: 8px;
  padding: 4px 8px;
  cursor: pointer;
}
.dl-map-first .detail-panel .profile-link a {
  font-weight: 700;
  color: var(--deep);
}
.dl-map-first .chip-ej {
  font-size: 9px;
  background: var(--lg);
  color: var(--deep);
  padding: 1px 6px;
  border-radius: 6px;
}
.dl-map-first .conf-alta {
  color: var(--fg);
}
.dl-map-first .conf-media {
  color: var(--sky);
}
.dl-map-first .conf-baja {
  color: #8a5a12;
}
.dl-map-first .mfh-map-wrap .leaflet-top.leaflet-right {
  top: 12px;
  z-index: 440;
}

/* Public profile: no fixed footer overlap */
body.hf-profile-active footer.rule {
  position: static;
}
body.hf-profile-active main {
  padding-bottom: 32px;
}
body.hf-profile-active .hf-card__sec--hidden {
  display: none;
}

@media (max-width: 640px) {
  body.cth-map-first-active main {
    height: calc(100vh - 88px);
    max-height: calc(100vh - 88px);
  }
  body.cth-map-first-active .envs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .dl-map-first .meth-desktop {
    display: none;
  }
  .dl-map-first .meth-mobile {
    display: block;
  }
  .dl-map-first .detail-panel {
    left: 0;
    right: 0;
    width: auto;
    bottom: 0;
    border-radius: 14px 14px 0 0;
    max-height: 42vh;
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
  }
  .dl-map-first .mfh-map-wrap .leaflet-top.leaflet-right {
    top: auto;
    bottom: 12px;
    right: 12px;
  }
  body.panel-open .dl-map-first .mfh-map-wrap .leaflet-top.leaflet-right {
    bottom: calc(42vh + 12px);
  }
  .dl-map-first .map-hint {
    bottom: auto;
    top: 8px;
    left: 8px;
    max-width: 72%;
  }
  body.panel-open .dl-map-first .map-hint {
    display: none;
  }
}