:root {
  --primary: #1667d9;
  --primary-dark: #1153b3;
  --video: #d64545;
  --bg: #f4f6f9;
  --card: #ffffff;
  --text: #1c2733;
  --muted: #5c6b7a;
  --border: #dde3ea;
  --shadow: 0 2px 12px rgba(20, 40, 70, 0.12);
  --radius: 10px;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* ---------- header ---------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 10px 20px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  z-index: 1100;
  flex-shrink: 0;
}

.brand-title { font-size: 1.3rem; font-weight: 700; letter-spacing: -0.01em; }
.brand-sub { color: var(--muted); font-size: 0.85rem; margin-top: 2px; }
.archive-status-chip { display: inline-block; margin-left: 8px; padding: 2px 7px; border: 1px solid var(--border); border-radius: 999px; font-size: .7rem; color: var(--muted); background: #f7f9fb; }
.header-search { flex: 1; max-width: 440px; position:relative; }
.header-search input, .panel-search input { width: 100%; padding: 9px 42px 9px 12px; border: 1px solid var(--border); border-radius: 7px; font: inherit; }
.header-search button { position:absolute; right:5px; top:4px; width:32px; height:32px; border:0; border-radius:5px; background:#f1f4f8; color:var(--text); font-size:1.2rem; cursor:pointer; }
.header-search button:hover { background:#e4ebf3; }


.topnav { display: flex; align-items: center; gap: 10px; }
.language-switch { display:flex; padding:3px; border:1px solid var(--border); border-radius:8px; background:#f5f7fa; }
.language-btn { min-width:30px; border:0; border-radius:5px; padding:5px 7px; background:transparent; color:var(--muted); font:inherit; font-size:.72rem; font-weight:750; cursor:pointer; }
.language-btn.active { background:#fff; color:var(--text); box-shadow:0 1px 4px rgba(20,40,70,.12); }

.count-chip {
  background: #eef3fa;
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
}

/* ---------- buttons ---------- */

.btn-primary {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}
.btn-primary:hover { background: var(--primary-dark); }

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 14px;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
}
.btn-ghost:hover { background: #f0f3f7; }

.btn-secondary {
  background: #f8f9fa;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}
.btn-secondary:hover { background: #e9ecef; }

.btn-sm { padding: 7px 12px; font-size: 0.85rem; border-radius: 7px; }

/* ---------- layout ---------- */

.map-wrap { --evidence-panel-width: clamp(250px, 19vw, 320px); --mobile-drawer-height:42vh; flex: 1; position: relative; min-width: 0; overflow: hidden; }
#map { position:absolute; top:0; left:var(--evidence-panel-width); right:0; bottom:152px; }
.latest-strip { position:absolute; left:var(--evidence-panel-width); right:0; bottom:34px; height:118px; z-index:840; background:rgba(255,255,255,.97); border-top:1px solid var(--border); padding:10px 16px 12px; transition:left .2s ease, right .2s ease; }
.latest-head { display:flex; align-items:center; justify-content:space-between; margin-bottom:8px; font-size:.8rem; }
.latest-scroll-controls { display:flex; align-items:center; gap:5px; }
.latest-scroll-controls button { width:26px; height:26px; border:1px solid var(--border); border-radius:50%; background:#fff; color:var(--primary-dark); font:inherit; font-size:1rem; line-height:1; cursor:pointer; }
.latest-scroll-controls button:hover:not(:disabled) { border-color:var(--primary); background:#eef4fd; }
.latest-scroll-controls button:disabled { opacity:.34; cursor:default; }
.latest-head a { color:var(--primary-dark); font-weight:700; text-decoration:none; }
.latest-list { display:flex; gap:10px; overflow-x:auto; overflow-y:hidden; scroll-snap-type:x proximity; scrollbar-width:thin; -webkit-overflow-scrolling:touch; padding-bottom:2px; }
.latest-card { flex:0 0 clamp(180px, 21vw, 240px); min-width:0; scroll-snap-align:start; display:grid; grid-template-columns:52px 1fr; grid-template-rows:auto auto; column-gap:8px; text-align:left; border:1px solid var(--border); border-radius:7px; padding:5px; background:#fff; color:var(--text); cursor:pointer; }
.latest-card:hover { background:#f5f8fc; border-color:#b9cbe1; }
.latest-media, .latest-placeholder { grid-row:1 / 3; width:52px; height:46px; border-radius:4px; background:#eef2f6; display:flex; align-items:center; justify-content:center; }
.latest-media { position:relative; overflow:hidden; }
.latest-media img { width:100%; height:100%; object-fit:cover; display:block; }
.latest-media .latest-placeholder { position:absolute; inset:0; color:var(--muted); font-size:1.1rem; }
.latest-placeholder { color:var(--muted); font-size:1.1rem; }
.latest-card strong { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:.73rem; line-height:1.25; }
.latest-card small { color:var(--muted); font-size:.68rem; margin-top:3px; }
.panel-about .support-disaster { margin:12px 0 8px; font-size:.79rem; font-weight:700; line-height:1.4; }
.support-disaster a { color:var(--primary-dark); text-decoration:none; }
.support-disaster a:hover { text-decoration:underline; }

.evidence-panel { position:absolute; top:0; left:0; bottom:34px; width:var(--evidence-panel-width); min-width:250px; max-width:320px; z-index:850; background:rgba(255,255,255,.97); border-right:1px solid var(--border); display:flex; flex-direction:column; transition:width .2s ease, min-width .2s ease; }
.drawer-handle { display:none; }
.panel-head { display:flex; align-items:center; justify-content:space-between; gap:10px; padding:16px; border-bottom:1px solid var(--border); }
.panel-head .panel-toggle { display:block; }
.panel-kicker { margin:0 0 3px; text-transform:uppercase; letter-spacing:.08em; font-size:.67rem !important; font-weight:700; color:var(--muted); }
.panel-field { padding:0 16px 12px; }
.panel-field label { font-size:.78rem; margin-bottom:5px; }
.panel-field select { width:100%; padding:8px 10px; border:1px solid var(--border); border-radius:7px; background:#fff; color:var(--text); font:inherit; font-size:.82rem; }
.timeline-control { margin:0 16px 12px; padding:10px 11px 9px; border:1px solid var(--border); border-radius:8px; background:#fff; }
.timeline-heading, .timeline-labels { display:flex; align-items:center; justify-content:space-between; gap:8px; }
.timeline-heading label { margin:0; font-size:.78rem; font-weight:700; }
.timeline-heading button { border:0; padding:2px 0; background:transparent; color:var(--primary-dark); font:inherit; font-size:.7rem; font-weight:700; cursor:pointer; }
.timeline-control input[type="range"] { width:100%; margin:9px 0 5px; accent-color:var(--primary); cursor:pointer; }
.timeline-control input[type="range"]:disabled { cursor:default; opacity:.45; }
.timeline-labels { color:var(--muted); font-size:.65rem; }
.timeline-labels strong { color:var(--text); font-size:.68rem; }
.panel-about { margin:0 16px 12px; padding:12px; background:#f7f9fb; border:1px solid var(--border); border-radius:8px; }
.panel-about h3 { margin:0 0 5px; font-size:.82rem; }
.panel-about p { margin:0 0 6px; color:var(--muted); font-size:.75rem; line-height:1.4; }
.panel-about a { color:var(--primary-dark); font-size:.75rem; font-weight:700; text-decoration:none; }
.creator-link { color:var(--primary-dark); font-weight:700; text-underline-offset:2px; }
.creator-link:hover { text-decoration:underline; }
.panel-stats { display:grid; grid-template-columns:repeat(3,1fr); margin:0 16px 12px; border:1px solid var(--border); border-radius:8px; overflow:hidden; }
.panel-stats div { padding:9px 4px; text-align:center; border-right:1px solid var(--border); }
.panel-stats div:last-child { border-right:0; }
.panel-stats strong, .panel-stats span { display:block; }
.panel-stats strong { font-size:1rem; }
.panel-stats span { color:var(--muted); font-size:.68rem; }
.panel-download { margin:0 16px 10px; padding:8px 10px; border:1px solid var(--border); border-radius:7px; background:#fff; color:var(--text); font:inherit; font-size:.78rem; font-weight:700; cursor:pointer; text-align:left; }
.panel-download:hover { background:#f0f3f7; }
.evidence-card-placeholder { width:68px; height:58px; display:flex; align-items:center; justify-content:center; background:#eef2f6; border-radius:5px; font-size:1.3rem; }
.panel-empty { padding:16px 4px; color:var(--muted); font-size:.82rem; }
.panel-head h2 { margin:0; font-size:1.05rem; text-transform:capitalize; }
.panel-head p { margin:4px 0 0; color:var(--muted); font-size:.8rem; }
.panel-toggle { border:1px solid var(--border); background:#fff; border-radius:6px; width:28px; height:28px; cursor:pointer; font-size:1.1rem; }
.panel-search { display:none; padding:12px 16px 8px; }
.evidence-panel.search-active .panel-search { display:block; }
.evidence-panel.search-active .evidence-list { display:block; }
.evidence-panel:not(.search-active) .evidence-list { display:none; }
.evidence-panel.search-active .panel-about, .evidence-panel.search-active .panel-stats, .evidence-panel.search-active .panel-download, .evidence-panel.search-active .panel-field, .evidence-panel.search-active .timeline-control { display:none; }
.panel-filters { display:flex; gap:5px; padding:0 16px 12px; flex-wrap:wrap; }
.panel-filter { display:inline-flex; align-items:center; gap:5px; border:1px solid var(--border); background:#fff; border-radius:999px; padding:5px 9px; font:inherit; font-size:.75rem; cursor:pointer; color:var(--muted); }
.panel-filter.active { background:var(--text); color:#fff; border-color:var(--text); }
.filter-icon { width:13px; height:13px; flex:0 0 13px; fill:none; stroke:currentColor; stroke-width:1.4; stroke-linecap:round; stroke-linejoin:round; }
.evidence-cluster-wrap { background:transparent; border:0; }
.evidence-cluster { display:flex; align-items:center; justify-content:center; border:3px solid rgba(255,255,255,.96); border-radius:50%; background:#165fbd; color:#fff; font-size:.82rem; font-weight:800; box-shadow:0 2px 9px rgba(13,55,105,.34), 0 0 0 5px rgba(22,103,217,.18); }
.evidence-list { overflow:auto; flex:1; padding:0 12px 12px; }
.evidence-card { display:grid; grid-template-columns:68px 1fr; gap:10px; padding:10px 4px; border-top:1px solid var(--border); cursor:pointer; }
.evidence-card:hover, .evidence-card.selected { background:#f5f8fc; }
.evidence-card img { width:68px; height:58px; object-fit:cover; border-radius:5px; background:#e8edf3; }
.evidence-card h3 { margin:0 0 4px; font-size:.88rem; line-height:1.25; }
.evidence-card p { margin:2px 0; color:var(--muted); font-size:.75rem; line-height:1.3; }

.map-tools {
  position: absolute;
  left: auto;
  right: 16px;
  top: 16px;
  bottom: auto;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
}
.map-wrap.panel-collapsed .evidence-panel { width:34px; min-width:34px; overflow:hidden; }
.map-wrap.panel-collapsed #map { left:34px; }
.map-wrap.panel-collapsed .latest-strip { left:34px; }
.map-wrap.panel-collapsed .evidence-panel .panel-head { padding:14px 3px; justify-content:center; }
.map-wrap.panel-collapsed .evidence-panel .panel-head > div { display:none; }
.map-wrap.panel-collapsed .evidence-panel .panel-toggle { width:27px; flex-shrink:0; }
.metadata-sheet-link { display: block; width: 100%; text-align: center; padding: 6px 9px; border-radius: 7px; background: rgba(255,255,255,.96); border: 1px solid var(--border); color: var(--primary-dark); font-size: .78rem; font-weight: 700; cursor: pointer; box-shadow: var(--shadow); }
.metadata-sheet-link:hover { background: #eef4fd; }
.map-style-control {
  position: static;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
}
.map-style-btn {
  border: 0;
  border-radius: 6px;
  padding: 7px 10px;
  color: var(--muted);
  background: transparent;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}
.map-style-btn:hover { background: #eef3fa; color: var(--text); }
.map-style-btn.active { background: var(--text); color: #fff; }

/* ---------- empty state ---------- */

.empty-state {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 900;
}

.empty-card {
  pointer-events: auto;
  background: var(--card);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 28px 34px;
  max-width: 460px;
  text-align: center;
  border: 1px solid var(--border);
}
.empty-icon { font-size: 2.6rem; }
.empty-card h2 { margin: 10px 0 8px; font-size: 1.35rem; }
.empty-card p { color: var(--muted); line-height: 1.5; margin: 0 0 18px; }

/* ---------- filter bar ---------- */

.filter-bar {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 1000;
  display: flex;
  gap: 6px;
  padding: 4px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
}
.filter-btn {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 10px;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  background: #fff;
  color: var(--muted);
  transition: all 0.15s ease;
}
.filter-btn:hover { background: #f0f3f7; }
.filter-btn.active { background: var(--text); color: #fff; border-color: var(--text); }
.filter-btn.active .dot.photo { background: #93c5fd; }
.filter-btn.active .dot.video { background: #fca5a5; }
.filter-btn.active .dot.document { background: #6ee7b7; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; }
.dot.photo { background: var(--primary); }
.dot.video { background: var(--video); }
.dot.document { background: #10b981; }
.location-confidence { display: inline-block; margin-left: 5px; padding: 2px 6px; border-radius: 999px; font-size: 0.72rem; font-weight: 700; white-space: nowrap; }
.location-confidence.gps { color: #166534; background: #dcfce7; }
.location-confidence.approximate { color: #92400e; background: #fef3c7; }
.location-confidence.user-set { color: #1e40af; background: #dbeafe; }

/* ---------- markers ---------- */

.pin-wrap { background: transparent; border: none; }

.pin {
  background: var(--primary);
  border: 2px solid #fff;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}
.pin-symbol { transform:rotate(45deg); fill:none; stroke:#fff; stroke-width:1.5; stroke-linecap:round; stroke-linejoin:round; }
.pin.video { background: var(--video); }
.pin.document { background: #10b981; }
.pin.pending { background: #f59e0b; animation: pulse 1.5s ease-in-out infinite; }
@keyframes pulse {
  0%, 100% { opacity: 1; transform: rotate(-45deg) scale(1); }
  50% { opacity: 0.7; transform: rotate(-45deg) scale(1.08); }
}

/* ---------- popups ---------- */

.leaflet-popup-content { margin: 14px 16px; }
.popup-card { width: 300px; }
.popup-thumb {
  width: 100%;
  height: 170px;
  object-fit: cover;
  border-radius: 8px;
  background: #e8edf3;
  display: block;
}
.popup-thumb.video, .detail-media.video {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.95rem;
  text-align: center;
  padding: 0 10px;
}
.popup-video-frame {
  border: 0;
  display: block;
  height: 170px;
}
.popup-card h3 { margin: 10px 0 4px; font-size: 1.05rem; line-height: 1.3; }
.popup-meta { margin: 0; color: var(--muted); font-size: 0.85rem; }
.popup-desc { margin: 8px 0 0; font-size: 0.92rem; line-height: 1.45; }
.popup-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }

/* ---------- modals ---------- */

.modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 25, 40, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 16px;
}

.modal-card {
  background: var(--card);
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
  width: 100%;
  max-width: 620px;
  max-height: 92vh;
  overflow-y: auto;
  padding: 24px;
}
.modal-card-tall { max-height: 95vh; }

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}
.modal-head h2 { margin: 0; font-size: 1.35rem; }
.modal-x {
  border: none;
  background: transparent;
  font-size: 1.1rem;
  color: var(--muted);
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 8px;
}
.modal-x:hover { background: #f0f3f7; color: var(--text); }

.steps { display: flex; gap: 8px; margin: 14px 0 4px; }
.step-dot {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--border);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.step-dot.active { background: var(--primary); color: #fff; }
.step-label { margin: 0 0 14px; color: var(--muted); font-size: 0.88rem; }

/* ---------- forms ---------- */

label, .form-label { display: block; font-weight: 600; font-size: 0.9rem; margin-bottom: 5px; }
.required::after { content: " *"; color: var(--video); }

input[type="text"], input[type="url"], input[type="file"], select, textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  color: var(--text);
  background: #fff;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--primary); outline-offset: 1px; border-color: var(--primary); }
input[type="file"] { padding: 9px; background: #fff; cursor: pointer; }
input[type="file"]::file-selector-button { border: 1px solid var(--border); border-radius: 6px; padding: 7px 10px; margin-right: 10px; background: #f5f7fa; color: var(--text); cursor: pointer; }

.local-preview { margin: 10px 0 16px; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: #eef2f6; }
.local-media { display: block; width: 100%; max-height: 220px; object-fit: contain; }
.preview-file-name { margin: 0; padding: 8px 12px; color: var(--muted); font-size: 0.85rem; }
.archive-status { margin: -6px 0 14px; color: var(--muted); font-size: 0.85rem; line-height: 1.4; }
.archive-status.ready { color: #1b6b44; }
.archive-status.missing { color: #8c5a12; }
.source-hint { margin: -6px 0 14px; color: var(--primary-dark); font-size: 0.85rem; line-height: 1.4; }
.source-link { display: inline-block; margin-top: 9px; color: var(--primary-dark); font-size: 0.85rem; font-weight: 600; text-decoration: none; }
.source-link:hover { text-decoration: underline; }

.btn-downvote {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 0.8rem;
  color: var(--muted);
  cursor: pointer;
  margin-left: auto;
  transition: all 0.15s ease;
}
.btn-downvote:hover { background: #fdecec; border-color: #f5c2c2; color: #8c1d1d; }
.downvote-count { font-weight: 600; }

.btn-downvote-detail {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 14px;
  font-size: 0.9rem;
  color: var(--muted);
  cursor: pointer;
  margin-left: 10px;
  transition: all 0.15s ease;
}
.btn-downvote-detail:hover { background: #fdecec; border-color: #f5c2c2; color: #8c1d1d; }

textarea { min-height: 96px; resize: vertical; }

.field-hint { margin: 6px 0 14px; color: var(--muted); font-size: 0.85rem; line-height: 1.4; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; margin-bottom: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.document-fields { display:grid; grid-template-columns:1fr 1.4fr; gap:12px 14px; margin-bottom:12px; }
.document-details { padding:14px; border:1px solid #cfe0f8; border-radius:9px; background:#f7fbff; }
.document-details textarea { min-height:76px; }
.optional-label { color:var(--muted); font-weight:400; }

.drive-preview {
  margin: 4px 0 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: #eef2f6;
}
.drive-preview img { display: block; width: 100%; max-height: 200px; object-fit: contain; }

.radio-row { border: none; padding: 0; margin: 0 0 14px; }
.radio-row legend { margin-bottom: 8px; }
.radio-row .radio-card {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 16px;
  margin-right: 10px;
  cursor: pointer;
  font-weight: 500;
  background: #fff;
}
.radio-row .radio-card:has(input:checked) { border-color: var(--primary); background: #eef4fd; }
.radio-row input[type="radio"] { width: 16px; height: 16px; accent-color: var(--primary); }

.mini-map { height: 260px; border-radius: var(--radius); border: 1px solid var(--border); }

.mini-map.hidden-map { height: 0; border: none; overflow: hidden; margin: 0; padding: 0; }

.unknown-location {
  background: #fef3c7;
  border: 1px solid #fcd34d;
}
.unknown-location:hover { background: #fde68a; }
.location-source-status { display:flex; align-items:flex-start; gap:10px; margin:8px 0 10px; padding:11px 12px; border:1px solid #86c99b; border-radius:8px; background:#eefbf2; color:#166534; }
.source-check { display:grid; place-items:center; width:19px; height:19px; flex:0 0 19px; border-radius:5px; background:#18733a; color:#fff; font-size:.78rem; font-weight:800; }
.location-source-status strong, .location-source-status small { display:block; }
.location-source-status strong { font-size:.88rem; }
.location-source-status small { margin-top:2px; color:#3f6f4d; font-size:.76rem; line-height:1.35; }

.form-section {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}
.form-section:first-of-type { margin-top: 0; padding-top: 0; border-top: none; }

.inline-row { display: flex; gap: 10px; margin-top: 10px; }
.inline-row input { flex: 1; }

.step-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }

.ack {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: #eef4fd;
  border: 1px solid #cfe0f7;
  border-radius: 8px;
  padding: 14px;
  cursor: pointer;
  font-weight: 400;
  font-size: 0.92rem;
  line-height: 1.5;
}
.ack input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--primary); flex-shrink: 0; }

.honeypot { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

.form-errors {
  background: #fdecec;
  color: #8c1d1d;
  border: 1px solid #f5c2c2;
  border-radius: 8px;
  padding: 10px 16px;
  margin-bottom: 14px;
  font-size: 0.9rem;
}
.form-errors ul { margin: 0; padding-left: 18px; }
.form-errors li { margin: 3px 0; }

/* ---------- detail view ---------- */

.detail-panel { position:absolute; top:64px; right:0; bottom:34px; width:25%; min-width:300px; max-width:390px; z-index:900; background:rgba(255,255,255,.98); border-left:1px solid var(--border); overflow:auto; }
.detail-panel-head { display:flex; justify-content:space-between; align-items:center; padding:16px; border-bottom:1px solid var(--border); font-size:.82rem; font-weight:700; color:var(--muted); }
.detail-panel #detailPanelBody { padding:16px; }
.map-wrap.detail-open #map { right:25%; }
.map-wrap.detail-open .latest-strip { right:25%; }
.map-wrap.detail-open .filter-bar { right: calc(25% + 16px); }
.utility-docs { display:none; }
.detail-card { max-width: 700px; }
.detail-title {
  margin: 4px 0 8px;
  font-size: clamp(1rem, 1.4vw, 1.15rem);
  line-height: 1.28;
  letter-spacing: -.01em;
  overflow-wrap: anywhere;
}
.detail-badge {
  font-size: 0.78rem;
  display: inline-block;
  background: #eef3fa;
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 999px;
  padding: 3px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 12px;
}
.detail-media {
  width: 100%;
  max-height: 55vh;
  object-fit: contain;
  background: #eef2f6;
  border-radius: var(--radius);
  display: block;
}
.video-frame { height: 380px; border: 0; }
.detail-video {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 220px;
  background: #eef2f6;
  border-radius: var(--radius);
  color: var(--muted);
  font-weight: 600;
  text-align: center;
  padding: 0 16px;
}
.detail-desc h3 { margin: 18px 0 6px; font-size: 1rem; }
.detail-desc p { margin: 0; line-height: 1.55; color: var(--text); }

.meta-table { width: 100%; border-collapse: collapse; margin-top: 16px; }
.meta-table td { padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: top; font-size: 0.95rem; }
.meta-table td:first-child { color: var(--muted); font-weight: 600; width: 140px; white-space: nowrap; }
.meta-table .coords { color: var(--muted); font-size: 0.82rem; font-weight: 400; }

.detail-actions { margin-top: 18px; }
.detail-actions .btn-secondary { margin: 8px 8px 0 0; }
.metadata-update-card { max-width: 560px; }
.metadata-update-card small { display:block; color:var(--muted); margin-top:5px; font-size:.8rem; }
.metadata-location-map { height:220px; border:1px solid var(--border); border-radius:8px; overflow:hidden; margin-top:8px; }
.verify-note { margin-top: 14px; color: var(--muted); font-size: 0.88rem; line-height: 1.5; }

/* ---------- how it works ---------- */

.how-list { margin: 10px 0 18px; padding-left: 22px; line-height: 1.6; }
.how-list li { margin: 8px 0; }
.how-note { margin: 8px 0 0; padding-left: 22px; line-height: 1.6; color: var(--muted); }
.how-note li { margin: 6px 0; }
#howModal h3 { margin: 18px 0 4px; font-size: 1.05rem; }
.metadata-card { max-width: 1200px; }
.sheet-intro { color: var(--muted); margin: 0 0 14px; line-height: 1.5; }
.sheet-table-wrap { overflow: auto; border: 1px solid var(--border); border-radius: 9px; }
.metadata-sheet table { width: 100%; min-width: 980px; border-collapse: collapse; font-size: .84rem; }
.metadata-sheet th { position: sticky; top: 0; background: #eef3fa; color: var(--muted); text-align: left; white-space: nowrap; }
.metadata-sheet th, .metadata-sheet td { padding: 9px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.metadata-sheet tr:last-child td { border-bottom: 0; }
.metadata-sheet td small { color: var(--muted); }
.metadata-sheet a { color: var(--primary-dark); font-weight: 600; white-space: nowrap; }

/* ---------- toast ---------- */

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #1c2733;
  color: #fff;
  padding: 13px 22px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  z-index: 3000;
  font-weight: 600;
  max-width: 90vw;
  text-align: center;
}

.hidden { display: none !important; }

/* ---------- status bar ---------- */

.status-bar {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  background: rgba(245, 158, 11, 0.95);
  color: #fff;
  padding: 10px 20px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 600;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
  animation: slideDown 0.3s ease-out;
  white-space: nowrap;
}
@keyframes slideDown {
  from { opacity: 0; transform: translateX(-50%) translateY(-8px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ---------- footer ---------- */

.map-footer {
  position: absolute;
  bottom: 0;
  height: 34px;
  left: 0;
  right: 0;
  z-index: 800;
  background: rgba(28, 39, 51, 0.88);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  padding: 6px 20px;
}
.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.footer-text {
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.72rem;
  line-height: 1.45;
  flex: 1;
}
.footer-text strong { color: #fff; }
.footer-links { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.footer-legend { display: flex; gap: 5px; }
.footer-legend .filter-btn { padding: 5px 8px; font-size: .75rem; }
.footer-legend .filter-btn.active { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.25); }
.footer-link {
  color: #bfdbfe;
  font-size: 0.72rem;
  font-weight: 600;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.1);
  padding: 6px 14px;
  border-radius: 6px;
  white-space: nowrap;
  border: 0;
  font-family: inherit;
  cursor: pointer;
}
.footer-link:hover { background: rgba(255, 255, 255, 0.2); color: #bfdbfe; }

/* ---------- responsive ---------- */

@media (max-width: 720px) {
  .topbar { padding: 10px 14px; }
  .header-search { order: 3; flex-basis: 100%; max-width: none; }
  .utility-docs { display: none; }
  #map { left:0; right:0; bottom:34px; }
  .evidence-panel { top:auto; left:0; right:0; bottom:34px; width:100%; max-width:none; min-width:0; height:var(--mobile-drawer-height); border:1px solid var(--border); border-bottom:0; border-radius:16px 16px 0 0; box-shadow:0 -8px 28px rgba(20,40,70,.16); overflow-y:auto; overscroll-behavior:contain; transition:height .2s ease; }
  .drawer-handle { position:sticky; top:0; z-index:3; display:flex; align-items:center; justify-content:center; width:100%; min-height:27px; padding:0; border:0; background:rgba(255,255,255,.97); touch-action:none; cursor:ns-resize; }
  .drawer-handle span { width:42px; height:4px; border-radius:99px; background:#aeb8c4; transition:width .15s ease, background .15s ease; }
  .drawer-handle.dragging span { width:58px; background:var(--primary); }
  .evidence-panel .panel-head { padding:6px 16px 10px; border-bottom:0; }
  .evidence-panel .panel-filters { padding-bottom:10px; }
  .evidence-panel .panel-about, .evidence-panel .panel-stats, .evidence-panel .panel-download { display:none; }
  .evidence-panel:not(.search-active) .evidence-list { display:block; flex:0 0 auto; overflow:visible; }
  .evidence-list { padding-bottom:24px; }
  .detail-panel { top: auto; left: 0; right: 0; bottom: 34px; width: 100%; max-width: none; min-width: 0; max-height: 68%; }
  .latest-strip { display:none; }
  .map-wrap.detail-open #map { right:0; bottom:34px; }
  .map-wrap.detail-open .latest-strip { right:0; }
  .map-tools { left:auto; right:10px; top:10px; bottom:auto; }
  .filter-bar { top: 10px; right: 10px; }
  .map-wrap.detail-open .filter-bar { right: 10px; }

  .brand-title { font-size: 1.1rem; }
  .modal-card { padding: 18px; }
  .form-grid { grid-template-columns: 1fr; }
  .document-fields { grid-template-columns:1fr; }
  .inline-row { flex-direction: column; }
  .popup-card { width: 240px; }
  .map-tools { left:auto; right:10px; top:10px; bottom:auto; }
  .filter-bar { right: 10px; top: 10px; max-width: calc(100vw - 20px); overflow-x: auto; gap: 4px; padding: 3px; }
  .filter-label { display: none; }
  .filter-btn { padding: 7px 9px; font-size: 0.78rem; }
  .footer-legend { display: none; }
  .panel-search { order: 3; }
  .map-wrap.panel-collapsed .evidence-panel { height:32px; width:100%; min-width:0; border-top:1px solid var(--border); overflow:hidden; }
  .map-wrap.panel-collapsed .evidence-panel > *:not(.drawer-handle) { display:none; }
  .count-chip { display: none; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
  .status-bar { font-size: 0.8rem; padding: 8px 16px; }
}
