/* Layer popup styles - separate file for clarity */
#layerPopup {
  display: none;
  position: fixed;
  top: 85px;
  left: 55px;
  width: 600px;
  height: 400px;
  background: #fff;
  border: 1px solid #ccc;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  z-index: 9999;
  flex-direction: column;
  box-sizing: border-box;
  overflow: visible;
}

#layerPopup > .layer-title {
  padding: 14px 16px;
  font-size: 16px;
  font-weight: bold;
  border-bottom: 1px solid #ddd;
  flex-shrink: 0;
}

#layerPopup .layer-lead {
  font-weight: bold;
  margin-top: 15px;
  margin-left: 10px;
}

#layerPopup .layer-body {
  margin: 15px 10px 30px 10px;
  overflow: visible;
}

#layerPopup table {
  border-collapse: collapse;
  width: 100%;
}

#layerPopup th,
#layerPopup td {
  border: 1px solid #ccc;
  padding: 10px 14px;
  text-align: center;
}

/* header background (keeps same as original inline style) */
#layerPopup th {
  background: #f0f0f0;
}

/* original markup used bold cells in tbody for the dates/labels */
#layerPopup tbody td {
  font-weight: bold;
}

#layerPopup .layer-links {
  margin-top: 20px;
}

#layerPopup .layer-bottom {
  padding: 10px 16px;
  margin-top: 10px;
  border-top: 1px solid #ddd;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

/* Mobile adjustments */
@media (max-width: 768px) {
  #layerPopup {
    left: 12px;
    right: 12px;
    top: 12px;
    width: auto;
    max-width: calc(100vw - 24px);
    height: auto;
    max-height: calc(100vh - 24px);
    overflow-y: auto;
  }

  #layerPopup > .layer-title {
    font-size: 15px;
    line-height: 1.35;
    word-break: keep-all;
  }

  #layerPopup .layer-lead {
    font-size: 13px;
    line-height: 1.45;
  }

  #layerPopup th,
  #layerPopup td {
    padding: 8px 10px;
    font-size: 13px;
  }

  #layerPopup .layer-bottom {
    padding: 8px 12px;
    gap: 8px;
  }
}

