html, body {
  height: 100%;
  margin: 0;
  font-family: -apple-system, system-ui, sans-serif;
}

#map {
  height: 100%;
  width: 100%;
}

/* Floating "use my location" button */
#locate-btn {
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(24px, env(safe-area-inset-bottom));
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  font-size: 26px;
  line-height: 56px;
  text-align: center;
  z-index: 1000;
  cursor: pointer;
  padding: 0;
}
#locate-btn:active {
  background: #f0f0f0;
}
#locate-btn[disabled] {
  opacity: 0.5;
}

#https-banner {
  position: fixed;
  top: env(safe-area-inset-top);
  left: 0;
  right: 0;
  background: #b45309;
  color: #fff;
  font-size: 13px;
  padding: 8px 12px;
  text-align: center;
  z-index: 1001;
}

/* Login/logout indicator - fixed on the map page, inline in the detail
   page's header (see .detail-header) */
#auth-status {
  font-size: 13px;
}
#auth-status a {
  color: #ff8c00;
  font-weight: 600;
  text-decoration: none;
}
body:not(.detail-page) #auth-status {
  position: fixed;
  top: max(12px, env(safe-area-inset-top));
  left: max(12px, env(safe-area-inset-left));
  background: #fff;
  padding: 6px 12px;
  border-radius: 14px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  z-index: 1000;
}

/* Report popup form + add-photo form - sized for touch */
.report-form,
.add-photo-form {
  font-size: 15px;
  min-width: 220px;
  max-width: min(80vw, 300px);
}
.report-form label,
.add-photo-form label {
  display: block;
  margin-top: 8px;
  font-size: 12px;
  color: #444;
}
.report-form input,
.report-form select,
.add-photo-form input {
  width: 100%;
  box-sizing: border-box;
  font-size: 16px; /* prevents iOS auto-zoom on focus */
  padding: 8px 6px;
  margin-top: 2px;
}
.report-form button,
.add-photo-form button {
  width: 100%;
  margin-top: 10px;
  min-height: 44px;
  font-size: 15px;
  border: none;
  border-radius: 6px;
  background: #ff8c00;
  color: #fff;
}
.report-form button[disabled],
.add-photo-form button[disabled] {
  opacity: 0.6;
}

.photo-gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}
.popup-photo {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 4px;
}

.view-details-link,
.signin-link {
  display: block;
  margin-top: 10px;
  color: #ff8c00;
  font-weight: 600;
  text-decoration: none;
  font-size: 14px;
}

/* Roomier popups + bigger tap targets on small screens */
@media (max-width: 480px) {
  .leaflet-popup-content-wrapper {
    border-radius: 10px;
  }
  .leaflet-popup-content {
    margin: 10px 12px;
  }
  .leaflet-container a.leaflet-popup-close-button {
    font-size: 22px;
    padding: 8px;
  }
}

/* Dog detail page */
body.detail-page {
  height: auto;
  min-height: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: 16px;
  padding-top: max(16px, env(safe-area-inset-top));
  padding-bottom: max(16px, env(safe-area-inset-bottom));
  box-sizing: border-box;
  color: #222;
}

.detail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.back-link {
  display: inline-block;
  color: #ff8c00;
  font-weight: 600;
  text-decoration: none;
  font-size: 15px;
}

.detail-gallery {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}
.detail-photo {
  width: 100%;
  border-radius: 10px;
  display: block;
}

.no-photos,
.not-found {
  color: #888;
}

.status-badge {
  display: inline-block;
  background: #ff8c00;
  color: #fff;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 13px;
  text-transform: capitalize;
}

.detail-description {
  font-size: 16px;
  line-height: 1.4;
  margin: 12px 0 6px;
  white-space: pre-wrap;
}

.detail-meta {
  font-size: 13px;
  color: #666;
}

.detail-updates {
  margin-top: 28px;
  border-top: 1px solid #eee;
  padding-top: 16px;
}
.detail-updates h2 {
  font-size: 16px;
  margin: 0 0 8px;
}
.placeholder-note {
  color: #888;
  font-size: 14px;
}
