* { box-sizing: border-box; }
body { margin: 0; font-family: Arial, Helvetica, sans-serif; color: #111; }
.shell { display: grid; grid-template-columns: 390px 1fr; height: 100vh; }
.panel { padding: 16px; overflow: auto; border-right: 1px solid #ddd; background: #fafafa; }
h1 { margin: 0 0 12px; font-size: 24px; }
h2 { font-size: 18px; margin: 12px 0 8px; }
label { display: block; font-weight: 700; font-size: 13px; margin: 10px 0; }
input, textarea, button { width: 100%; padding: 8px; margin-top: 4px; font: inherit; }
button { cursor: pointer; background: #0d5cab; color: white; border: 0; border-radius: 4px; font-weight: 700; }
button:disabled { background: #999; cursor: not-allowed; }
.grid3 { display: grid; grid-template-columns: 1fr; gap: 0; }
#map { height: 100vh; width: 100%; }
.metrics { background: white; border: 1px solid #ddd; border-radius: 6px; padding: 10px; font-size: 13px; }
.metrics table { width: 100%; border-collapse: collapse; }
.metrics td { padding: 4px 0; border-bottom: 1px solid #eee; }
.metrics td:last-child { text-align: right; font-weight: 700; }
.muted, .hint { color: #555; font-size: 13px; }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.leaflet-popup-content input { width: 220px; }
.report-body { background: #eee; }
.report-toolbar { position: sticky; top: 0; z-index: 9999; padding: 10px; background: #222; color: white; display:flex; gap:10px; align-items:center; }
.report-toolbar button { width: auto; padding: 8px 14px; }
.report-page { width: 11in; height: 8.5in; margin: 20px auto; background: white; display: grid; grid-template-columns: 2.65in 1fr; padding: 0.25in; gap: 0.2in; position: relative; }
.report-left h1 { font-size: 22px; margin-bottom: 6px; }
.report-left h2 { font-size: 13px; margin: 0 0 4px; font-weight: 400; }
.report-left p, .report-left li { font-size: 10px; }
.report-left h3 { font-size: 12px; margin: 10px 0 5px; }
.report-logo { max-width: 1.9in; max-height: 0.85in; margin: 0 0 10px; display:block; }
.report-logo-top { margin-top: 0; }
.metric-table { width: 100%; border-collapse: collapse; font-size: 9px; }
.metric-table td { border-bottom: 1px solid #ddd; padding: 3px 0; }
.metric-table td:last-child { text-align: right; font-weight: 700; }
.report-map-wrap { position: relative; }
#reportMap { width: 100%; height: 7.75in; border: 1px solid #ccc; }
.report-north-arrow { position: absolute; left: 12px; top: 12px; width: 0.42in; max-height: 0.9in; z-index: 5000; pointer-events: none; filter: drop-shadow(0 1px 2px rgba(255,255,255,0.9)); }
.report-scale { position: absolute; left: 12px; bottom: 28px; z-index: 5000; pointer-events: none; font-family: Arial, Helvetica, sans-serif; color: #111; text-shadow: 0 1px 2px #fff; }
.report-scale-bar { width: 100px; height: 8px; border-left: 2px solid #111; border-right: 2px solid #111; border-bottom: 3px solid #111; background: rgba(255,255,255,0.55); }
.report-scale-label { font-size: 10px; font-weight: 700; margin-top: 2px; text-align: center; }
@media print { .no-print { display:none; } .report-page { margin:0; box-shadow:none; } body { background:white; } }
.status { margin-top: 8px; font-size: 0.9rem; }
.status.error { color: #b00020; font-weight: 600; }
.status.ok { color: #006b3c; font-weight: 600; }

.checkline { display:flex; gap:8px; align-items:center; font-weight:600; }
.checkline input { width:auto; margin:0; }
.process-log { max-height:150px; overflow:auto; background:#111; color:#ddd; padding:8px; border-radius:4px; white-space:pre-wrap; font-size:11px; }

.exclusion-number-label {
  background: #7b1fa2;
  border: 2px solid #ffffff;
  color: #ffffff;
  border-radius: 999px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.45);
  font-weight: 700;
  font-size: 13px;
  line-height: 18px;
  text-align: center;
  width: 20px;
  height: 20px;
  padding: 0;
}

.exclusion-number-label::before {
  display: none;
}

.report-static-map {
  display: block;
  object-fit: fill;
  border: 1px solid #ccc;
}

.progress-wrap { margin: 8px 0 6px; }
.progress-wrap.hidden { display: none; }
.progress-label { font-size: 12px; color: #333; margin-bottom: 4px; font-weight: 700; }
.progress { width: 100%; height: 8px; background: #e6e6e6; border-radius: 999px; overflow: hidden; border: 1px solid #d5d5d5; }
.progress-bar { height: 100%; width: 0%; background: #0d5cab; border-radius: 999px; transition: width 350ms ease; }
.progress-wrap.compact { margin: 0 0 6px; }
.action-with-progress { min-width: 0; }
.process-log { display: none; }

.map-legend, .report-legend {
  background: rgba(255,255,255,0.92);
  border: 1px solid #bbb;
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 12px;
  line-height: 1.35;
  box-shadow: 0 1px 5px rgba(0,0,0,0.22);
}
.map-legend .legend-title, .report-legend .legend-title {
  font-weight: 700;
  margin-bottom: 4px;
}
.legend-subtitle {
  font-weight: 700;
  margin-top: 6px;
  font-size: 11px;
}
.legend-box, .legend-dot, .legend-line {
  display: inline-block;
  vertical-align: middle;
  margin-right: 6px;
}
.legend-box {
  width: 17px;
  height: 11px;
  border: 1px solid #333;
}
.legend-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 1px solid #111;
}
.legend-line {
  width: 18px;
  height: 0;
  border-top: 3px solid #004da8;
}
.point-black { background:#111; }
.coverage-box { background: rgba(77,128,255,0.35); border-color:#235bdb; }
.missed-box { background: rgba(255,23,68,0.35); border-color:#b00020; }
.exclusion-box { background: rgba(206,147,216,0.52); border-color:#7b1fa2; }
.report-legend {
  position: absolute;
  right: 12px;
  top: 12px;
  bottom: auto;
  z-index: 5000;
  pointer-events: none;
  font-size: 9px;
  padding: 6px 8px;
}
.report-legend .legend-box { width: 14px; height: 9px; }
.report-legend .legend-line { width: 15px; border-top-width: 2px; }


/* v15 restore + small layout cleanup */
.shell { grid-template-columns: 410px minmax(0, 1fr); }
.panel h1 { font-size: 26px; margin-bottom: 14px; }
#uploadForm label { margin-bottom: 8px; }
#uploadForm input[type="file"] { background: white; border: 1px solid #ccc; border-radius: 4px; }
#uploadForm input:not([type="checkbox"]), #uploadForm textarea { border: 1px solid #bbb; border-radius: 4px; background: white; }
#uploadForm textarea { resize: vertical; }
.grid3 { grid-template-columns: 1fr; gap: 0; }
.actions { grid-template-columns: 1fr; }
.map-legend { margin-top: 10px; }
.report-scale { bottom: 18px; }
.report-scale-bar { background: rgba(255,255,255,0.70); }
.report-page { box-shadow: 0 2px 16px rgba(0,0,0,0.18); }
@media print { .report-page { box-shadow: none; } }

/* v17 upload context controls */
.file-row {
  display: grid;
  grid-template-columns: 1fr 34px;
  gap: 6px;
  align-items: end;
}
.file-row input[type="file"] { min-width: 0; }
button.icon-btn {
  width: 34px;
  height: 34px;
  padding: 0;
  margin-top: 4px;
  background: #f2f2f2;
  color: #333;
  border: 1px solid #c8c8c8;
  border-radius: 4px;
  font-size: 15px;
  line-height: 1;
}
button.icon-btn:hover { background: #e5e5e5; }
button.icon-btn:disabled { opacity: 0.45; background: #f2f2f2; color: #777; }

button.secondary-btn {
  background: #eef4fb;
  color: #0d5cab;
  border: 1px solid #b9d1ea;
}
button.secondary-btn:hover { background: #e3eefb; }
button.secondary-btn.active { background: #0d5cab; color: #fff; border-color: #0d5cab; }
button.secondary-btn:disabled { background: #f2f2f2; color: #777; border-color: #ddd; }

.field-hint { display:block; font-weight:400; color:#666; font-size:11px; margin-top:3px; }
