.cemetery-contact-form,
.cemetery-map-wrap {
  max-width: 1000px;
  margin: 0 auto;
}

.cemetery-contact-form input,
.cemetery-contact-form textarea,
.cemetery-contact-form button,
.cemetery-map-toolbar select,
.cemetery-map-view-toggle button {
  width: 100%;
  max-width: 520px;
  padding: 0.6rem;
  box-sizing: border-box;
}

.cemetery-contact-form button {
  max-width: 180px;
  cursor: pointer;
}

.cemetery-honeypot {
  position: absolute;
  left: -9999px;
}

.cemetery-notice {
  padding: 0.8rem 1rem;
  margin: 1rem 0;
  border: 1px solid currentColor;
}

.cemetery-map {
  height: 720px;
  width: 100%;
  border: 1px solid #ccc;
  background: #f6f6f6;
}

.cemetery-3d-view {
  height: 720px;
  width: 100%;
  border: 1px solid #ccc;
  background: #f3f5f7;
  box-sizing: border-box;
  position: relative;
}

.cemetery-3d-view canvas {
  display: block;
  height: 100%;
  width: 100%;
}

.cemetery-3d-status {
  left: 50%;
  padding: 0.75rem 1rem;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
}

.cemetery-3d-view-loaded .cemetery-3d-status:empty {
  display: none;
}

.cemetery-map-toolbar {
  margin: 1rem 0;
}

.cemetery-map-view-toggle {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 0.75rem;
}

.cemetery-map-view-toggle button {
  border: 1px solid #444;
  background: #fff;
  cursor: pointer;
  max-width: 140px;
}

.cemetery-map-view-toggle button.is-active {
  background: #222;
  color: #fff;
}

.cemetery-map-note {
  font-size: 0.9rem;
}

.cemetery-overhead-overlay {
  pointer-events: none;
}

.cemetery-geotiff-overlay {
  image-rendering: auto;
  pointer-events: none;
}

.cemetery-geotiff-overlay-error {
  display: none;
}

.cemetery-map-error {
  border: 1px solid #b00020;
  color: #b00020;
  margin-top: 0.75rem;
  padding: 0.75rem 1rem;
}

.cemetery-plot-marker {
  border: 2px solid #333;
  border-radius: 999px;
  width: 18px;
  height: 18px;
  display: block;
  background: white;
}

.cemetery-plot-available { background: #d8f3dc; }
.cemetery-plot-reserved { background: #fff3b0; }
.cemetery-plot-occupied { background: #d9d9d9; }
.cemetery-plot-unknown { background: #ffd6a5; }

.cemetery-plot-rectangle {
  cursor: pointer;
}

.cemetery-plot-rectangle-available {
  stroke: #147a2e;
}

.cemetery-plot-rectangle-reserved {
  stroke: #9a6a00;
}

.cemetery-plot-admin-controls {
  border-top: 1px solid #ddd;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
}

.cemetery-plot-admin-form {
  border-top: 1px solid #ddd;
  display: grid;
  gap: 0.55rem;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
}

.cemetery-plot-admin-field {
  display: grid;
  gap: 0.25rem;
}

.cemetery-plot-admin-field span {
  font-size: 0.85rem;
  font-weight: 700;
}

.cemetery-plot-admin-field input,
.cemetery-plot-admin-field select,
.cemetery-plot-admin-field textarea {
  box-sizing: border-box;
  max-width: 100%;
  padding: 0.4rem;
  width: 100%;
}

.cemetery-plot-admin-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.cemetery-plot-status-button {
  background: #222;
  border: 1px solid #222;
  color: #fff;
  cursor: pointer;
  padding: 0.45rem 0.7rem;
}

.cemetery-plot-status-button:disabled {
  cursor: wait;
  opacity: 0.7;
}

.cemetery-plot-status-message {
  font-size: 0.85rem;
  margin-top: 0.35rem;
}

.cemetery-photo-thumb {
  display: block;
  max-width: 220px;
  max-height: 180px;
  height: auto;
  margin-top: 0.5rem;
}

.cemetery-photo-viewer .cemetery-photo-thumb {
  margin-top: 0;
  max-height: 100%;
  max-width: 100%;
}

.cemetery-photo-viewer {
  border: 1px solid #d6d6d6;
  box-sizing: border-box;
  display: block;
  margin-top: 0.5rem;
  max-height: 180px;
  max-width: 220px;
  overflow: auto;
}

.cemetery-photo-viewer-zoomed {
  cursor: move;
  max-height: min(58vh, 520px);
  max-width: min(76vw, 720px);
  overflow: auto;
}

.cemetery-photo-zoomable {
  cursor: zoom-in;
}

.cemetery-photo-thumb-zoomed {
  cursor: zoom-out;
  max-height: none;
  max-width: none;
  margin-top: 0;
  width: 960px;
}

.cemetery-map .leaflet-popup-content {
  max-height: min(68vh, 600px);
  max-width: min(80vw, 760px);
  overflow: auto;
}
