* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, sans-serif; }

#map {
  position: fixed;
  left: 0;
  top: 0;
  width: 66.67%;
  height: 100vh;
}
#right-column {
  position: fixed;
  right: 0;
  top: 0;
  width: 33.33%;
  height: 100vh;
  display: flex;
  flex-direction: column;
  border-left: 1px solid #ccc;
}
#panel {
  flex: 0 1 auto;
  overflow: auto;
  padding: 8px;
  min-height: 0;
}
#right-column.with-form #panel {
  max-height: 35%;
}
.form-embed {
  display: none;
  flex: 1;
  min-height: 0;
  background: #fafafa;
}
#right-column.with-form .form-embed {
  display: block;
}
.form-embed iframe {
  width: 100%;
  height: 100%;
  border: none;
}
.form-toggle-bar {
  flex: 0 0 auto;
  padding: 8px 8px 4px;
  border-bottom: 1px solid #eee;
  background: #fafafa;
}
.form-toggle-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: #333;
}
.form-toggle-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.form-toggle-switch {
  position: relative;
  width: 40px;
  height: 22px;
  background: #ccc;
  border-radius: 11px;
  transition: background 0.2s;
}
.form-toggle-switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
  transition: transform 0.2s;
}
.form-toggle-input:checked + .form-toggle-switch {
  background: #1b5e20;
}
.form-toggle-input:checked + .form-toggle-switch::after {
  transform: translateX(18px);
}
table { width: 100%; border-collapse: collapse; font-size: 13.5px; line-height: 1.25; }
th, td { padding: 3px 6px; text-align: left; border-bottom: 1px solid #eee; }
th { font-weight: 600; }
.panel-upload { margin: 0 0 8px; font-size: 12px; }
.upload-label { cursor: pointer; }
.panel-upload input[type="file"] { font-size: 11px; }

.count-badge {
  background: rgba(30, 60, 120, 0.9);
  border: 3px solid #fff;
  border-radius: 50%;
  font-weight: 700;
  font-size: 16px;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
}
.count-badge span { line-height: 1; }

.church-marker {
  background: #c62828;
  border: 3px solid #fff;
  border-radius: 8px;
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0.05em;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 10px rgba(0,0,0,0.45);
}
.church-marker span { line-height: 1; }

#map-loading {
  position: fixed;
  left: 0;
  bottom: 0;
  width: 66.67%;
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 500;
  transition: opacity 0.2s ease;
}
#map-loading.loading-subsequent {
  left: auto;
  right: calc(33.33% + 10px);
  bottom: 26px;
  width: auto;
  min-height: 0;
}
#map-loading.loading-hidden {
  opacity: 0;
  visibility: hidden;
}
#map-loading:not(.loading-hidden) {
  opacity: 1;
  visibility: visible;
}
.loading-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: rgba(255,255,255,0.95);
  border-radius: 8px;
  box-shadow: 0 -2px 8px rgba(0,0,0,0.15);
}
#map-loading.loading-subsequent .loading-wrap {
  gap: 4px;
  padding: 6px 10px;
  border-radius: 6px;
}
.loading-updating { display: none; }
#map-loading.loading-subsequent .loading-initial { display: none; }
#map-loading.loading-subsequent .loading-updating { display: inline; }
#map-loading.loading-subsequent .loading-text {
  font-size: 11px;
  font-weight: 600;
  color: #555;
}
.loading-text {
  font-size: 14px;
  font-weight: 600;
  color: #333;
}
.loading-bar {
  width: 280px;
  height: 12px;
  background: rgba(0,0,0,0.15);
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
#map-loading.loading-subsequent .loading-bar {
  width: 100px;
  height: 6px;
  border-radius: 3px;
}
#map-loading.loading-subsequent .loading-fill {
  border-radius: 3px;
}
.loading-fill {
  height: 100%;
  width: 45%;
  background: linear-gradient(90deg, #1b5e20, #4caf50);
  border-radius: 6px;
  animation: loading-slide 1.2s ease-in-out infinite;
}
@keyframes loading-slide {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(320%); }
}

