/* ===== Weerfoto Map Benelux ===== */
:root {
  --c-bg: #0f172a;
  --c-panel: #1e293b;
  --c-panel-2: #263449;
  --c-border: #334155;
  --c-text: #e2e8f0;
  --c-muted: #94a3b8;
  --c-accent: #38bdf8;
  --c-accent-2: #0ea5e9;
  --c-ok: #34d399;
  --c-warn: #fbbf24;
  --c-danger: #f87171;
  --radius: 10px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--c-bg);
  color: var(--c-text);
  display: flex;
  flex-direction: column;
}

/* ---- Topbar ---- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.6rem 1rem;
  background: var(--c-panel);
  border-bottom: 1px solid var(--c-border);
  z-index: 1100;
  flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 0.7rem; }
.brand-icon { font-size: 1.8rem; }
.brand-logo { height: 38px; width: auto; display: block; }
.brand h1 { margin: 0; font-size: 1.1rem; }
.subtitle { margin: 0; font-size: 0.75rem; color: var(--c-muted); }
.topbar-actions { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }

.badge {
  font-size: 0.7rem;
  padding: 0.2rem 0.55rem;
  border-radius: 99px;
  border: 1px solid var(--c-border);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.badge-demo { color: var(--c-warn); border-color: var(--c-warn); }
.badge-live { color: var(--c-ok); border-color: var(--c-ok); }

/* ---- Buttons ---- */
.btn {
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 0.5rem 0.9rem;
  font-size: 0.85rem;
  cursor: pointer;
  text-decoration: none;
  color: var(--c-text);
  background: var(--c-panel-2);
  transition: filter 0.15s, transform 0.05s;
}
.btn:hover { filter: brightness(1.15); }
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--c-accent-2); font-weight: 600; }
.btn-secondary { border-color: var(--c-border); }
.btn-ghost { background: transparent; border-color: var(--c-border); }
.btn-small { padding: 0.25rem 0.6rem; font-size: 0.75rem; }
.btn-icon {
  padding: 0.3rem 0.45rem;
  font-size: 0.85rem;
  line-height: 1;
  margin-right: 0.25rem;
}
.btn-ok { background: #065f46; }
.btn-danger { background: #7f1d1d; }
.btn-support { background: #be123c; color: #fff; font-weight: 600; }

/* ---- Map ---- */
#map { flex: 1; min-height: 0; background: #0b1120; }

/* Eigen Nederlandstalige kaartlabels (bovenop dark_nolabels) */
.map-label {
  position: absolute;
  transform: translate(-50%, -50%);
  color: #8b99ad;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
  pointer-events: none;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9), 0 0 6px rgba(0, 0, 0, 0.7);
}
.map-label-country {
  color: #5f6f85;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.2em;
}

/* ---- Weertype-filter (klikbare legende in het activiteitspaneel) ---- */
.cat-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  background: transparent;
  color: var(--c-text);
  border: 1px solid transparent;
  border-radius: 99px;
  padding: 0.12rem 0.35rem;
  font-size: 0.68rem;
  cursor: pointer;
  white-space: nowrap;
  text-align: left;
  transition: opacity 0.15s, border-color 0.15s;
}
.cat-chip .cat-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex: none;
}
.cat-chip.off { opacity: 0.35; }
.cat-chip.off .cat-dot { background: var(--c-muted) !important; }
.cat-chip:hover { border-color: var(--c-accent); }

/* Categoriekeuze in het uploadformulier */
.cat-picker { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.cat-pick {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.74rem;
  padding: 0.28rem 0.6rem;
  background: var(--c-panel-2);
  color: var(--c-text);
  border: 1px solid var(--c-border);
  border-radius: 8px;
  cursor: pointer;
}
.cat-pick .cat-dot { width: 10px; height: 10px; border-radius: 50%; }
.cat-pick.active { border-color: #fff; box-shadow: 0 0 0 1px #fff inset; }

/* Verified-badge in de popup */
.verified-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  font-size: 0.62rem;
  font-weight: 700;
  color: #fff;
  background: var(--c-accent-2);
  border-radius: 99px;
  padding: 0.05rem 0.4rem;
  margin-left: 0.3rem;
  vertical-align: middle;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* ---- Activiteitspaneel (archief + grafiek) ---- */
.activity-panel {
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 0.6rem 0.7rem 0.5rem;
}
.ap-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  margin-bottom: 0.4rem;
}
.ap-title { font-size: 0.78rem; font-weight: 600; margin-right: auto; }
.ap-toggle {
  background: none;
  border: 1px solid var(--c-border);
  border-radius: 6px;
  color: var(--c-muted);
  cursor: pointer;
  font-size: 0.7rem;
  line-height: 1;
  padding: 0.22rem 0.4rem;
}
.ap-toggle:hover { border-color: var(--c-accent); color: var(--c-text); }
.activity-panel.collapsed .ap-head { margin-bottom: 0; }
.activity-panel.collapsed .ap-stats,
.activity-panel.collapsed .ap-chart-wrap,
.activity-panel.collapsed .ap-axis,
.activity-panel.collapsed .ap-filter-title,
.activity-panel.collapsed .ap-legend { display: none; }
.range-tabs { display: flex; gap: 2px; }
.range-tab {
  font-size: 0.68rem;
  padding: 0.15rem 0.45rem;
  background: transparent;
  color: var(--c-muted);
  border: 1px solid var(--c-border);
  cursor: pointer;
}
.range-tab:first-child { border-radius: 6px 0 0 6px; }
.range-tab:last-child { border-radius: 0 6px 6px 0; }
.range-tab.active {
  background: var(--c-panel-2);
  color: var(--c-text);
  border-color: var(--c-accent);
}
.ap-stats {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin-bottom: 0.3rem;
}
.ap-count { font-size: 1.25rem; font-weight: 600; line-height: 1; }
.ap-count-label { font-size: 0.68rem; color: var(--c-muted); }
.ap-delta { font-size: 0.68rem; color: var(--c-muted); width: 100%; }
.ap-delta.up { color: var(--c-ok); }
.ap-delta.down { color: var(--c-danger); }
.ap-chart-wrap { position: relative; }
#ap-chart { display: block; }
.ap-tooltip {
  position: absolute;
  pointer-events: none;
  background: var(--c-panel-2);
  border: 1px solid var(--c-border);
  border-radius: 6px;
  padding: 0.25rem 0.5rem;
  font-size: 0.7rem;
  white-space: nowrap;
  z-index: 10;
  transform: translate(-50%, -100%);
}
.ap-tooltip .val { font-weight: 700; font-size: 0.8rem; }
.ap-tooltip .lbl { color: var(--c-muted); }
.ap-axis {
  display: flex;
  justify-content: space-between;
  font-size: 0.62rem;
  color: var(--c-muted);
  margin-top: 2px;
}
.ap-filter-title {
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--c-muted);
  border-top: 1px solid var(--c-border);
  margin-top: 0.5rem;
  padding-top: 0.45rem;
}
.ap-legend {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: repeat(3, auto);
  grid-auto-flow: column; /* eerst de linkerkolom vullen: zon, regen, onweer */
  gap: 0.15rem 0.4rem;
  margin-top: 0.25rem;
}
.legend-item { display: flex; align-items: center; gap: 0.35rem; }
.legend-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--c-accent); display: inline-block;
}
.legend-dot-new { background: #fff; box-shadow: 0 0 6px 2px rgba(56, 189, 248, 0.9); }

/* ---- Pin + blitzortung-stijl animatie ----
   Een grote, draaiende open cirkel (dash-ring) draait naar binnen en
   krimpt tot op de pin; daarna popt de stip zelf tevoorschijn. */
.wf-pin { position: relative; width: 100%; height: 100%; cursor: pointer; }
.wf-pin .ring {
  position: absolute;
  left: 50%; top: 50%;
  width: 64px; height: 64px;
  margin: -32px 0 0 -32px;
  border-radius: 50%;
  border: 3px solid transparent;
  border-top-color: #fff;
  border-right-color: #fff;
  border-bottom-color: rgba(255,255,255,0.25);
  opacity: 0;
  pointer-events: none;
}
.wf-pin.animate .ring {
  animation: wf-spin-in 1.1s cubic-bezier(0.3, 0.7, 0.4, 1) forwards;
}
@keyframes wf-spin-in {
  0%   { opacity: 1; transform: scale(2.4) rotate(0deg); }
  70%  { opacity: 1; transform: scale(0.6) rotate(540deg); }
  100% { opacity: 0; transform: scale(0.15) rotate(720deg); }
}
.wf-pin .dot {
  position: absolute;
  left: 50%; top: 50%;
  width: 20px; height: 20px;
  margin: -10px 0 0 -10px;
  border-radius: 50%;
  background: var(--pin-color, var(--c-accent-2));
  border: 2px solid #fff; /* surface-ring: houdt pins leesbaar op elke ondergrond */
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.35);
  transform: scale(1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  line-height: 1;
}
.wf-pin.animate .dot {
  animation: wf-pop 0.35s ease-out 0.85s backwards;
}
@keyframes wf-pop {
  0%   { transform: scale(0); }
  60%  { transform: scale(1.6); }
  100% { transform: scale(1); }
}
.wf-pin.recent .dot {
  animation: wf-pulse 1.6s ease-in-out 1.2s infinite;
}
@keyframes wf-pulse {
  0%, 100% { box-shadow: 0 0 6px 1px rgba(255,255,255,0.9); }
  50%      { box-shadow: 0 0 14px 5px rgba(56, 189, 248, 0.9); }
}

/* ---- Popup ---- */
.leaflet-popup-content-wrapper {
  background: var(--c-panel);
  color: var(--c-text);
  border-radius: var(--radius);
  border: 1px solid var(--c-border);
}
.leaflet-popup-tip { background: var(--c-panel); }
.wf-popup { width: 240px; }
/* Vast fotovak: de popup heeft zo meteen zijn definitieve hoogte,
   waardoor Leaflets autopan in één keer juist rekent (een later
   ladende foto verandert de maat niet meer). */
.wf-photo-wrap {
  position: relative;
  height: 200px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.25);
  overflow: hidden;
}
.wf-popup img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain; /* volledige foto tonen, nooit bijsnijden */
}
.like-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid var(--c-border);
  border-radius: 99px;
  font-size: 1.05rem;
  line-height: 1;
  padding: 0.35rem 0.45rem;
  cursor: pointer;
  transition: transform 0.1s;
}
.like-btn:active { transform: scale(1.25); }
.like-btn.liked { border-color: #f472b6; }
.likes-line .like-count { font-weight: 700; color: var(--c-text); }
.wf-popup h3 { margin: 0.5rem 0 0.15rem; font-size: 0.95rem; }
.wf-popup .meta { font-size: 0.75rem; color: var(--c-muted); margin: 0.1rem 0; }
.wf-popup .tags { margin-top: 0.4rem; display: flex; flex-wrap: wrap; gap: 0.25rem; }

.wf-popup .share {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.55rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--c-border);
}
.share-btn {
  flex: 1;
  text-align: center;
  font-size: 0.72rem;
  font-weight: 600;
  text-decoration: none;
  color: #fff;
  border: 1px solid var(--c-border);
  border-radius: 7px;
  padding: 0.3rem 0.4rem;
  transition: filter 0.15s;
}
.share-btn:hover { filter: brightness(1.25); }
.share-x { background: #000; }
.share-fb { background: #1877f2; }
/* Leaflet kleurt links in popups zelf in (.leaflet-container a);
   deze specifiekere selector houdt de deelknoppen wit. */
.leaflet-container a.share-btn { color: #fff; }
.device-code { font-size: 0.68rem; color: var(--c-muted); }

.tag-chip {
  font-size: 0.68rem;
  background: rgba(56, 189, 248, 0.15);
  color: var(--c-accent);
  border: 1px solid rgba(56, 189, 248, 0.4);
  border-radius: 99px;
  padding: 0.1rem 0.5rem;
}

/* ---- Modal ---- */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(2, 6, 23, 0.75);
  display: flex; align-items: center; justify-content: center;
  z-index: 2000;
  padding: 1rem;
}
.modal {
  background: var(--c-panel);
  border: 1px solid var(--c-border);
  border-radius: 14px;
  width: 100%; max-width: 480px;
  max-height: 92vh;
  display: flex; flex-direction: column;
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--c-border);
}
.modal-header h2 { margin: 0; font-size: 1.05rem; }
.modal-close {
  background: none; border: none; color: var(--c-muted);
  font-size: 1.5rem; cursor: pointer; line-height: 1;
}
.modal-body { padding: 1rem; overflow-y: auto; }
.modal-footer { margin-top: 0.8rem; }

.field { display: block; margin-bottom: 0.9rem; }
.field > span {
  display: block; font-size: 0.78rem; color: var(--c-muted);
  margin-bottom: 0.3rem; font-weight: 600;
}
.field em { color: var(--c-danger); font-style: normal; }
.field input[type="text"], .field input[type="email"],
.field input[type="password"], .field input[type="file"],
#place-search {
  width: 100%;
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: 8px;
  color: var(--c-text);
  padding: 0.5rem 0.6rem;
  font-size: 0.85rem;
}
.photo-preview { margin-top: 0.5rem; max-width: 100%; max-height: 160px; border-radius: 8px; }

.field-row { display: flex; gap: 0.6rem; }
.field-row .field { flex: 1; }
.field-note {
  font-size: 0.72rem;
  color: var(--c-muted);
  margin: -0.4rem 0 0.9rem;
}
.checkbox-field {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.76rem;
  color: var(--c-muted);
  margin-bottom: 0.7rem;
  cursor: pointer;
}
.checkbox-field input {
  margin-top: 0.15rem;
  accent-color: var(--c-accent-2);
  flex: none;
}
.checkbox-field em { color: var(--c-danger); font-style: normal; }

/* Tags in het uploadformulier */
.tag-suggestions, .tag-selected { display: flex; flex-wrap: wrap; gap: 0.3rem; margin: 0.3rem 0; }
.tag-suggest {
  font-size: 0.72rem; cursor: pointer;
  background: var(--c-panel-2); color: var(--c-text);
  border: 1px solid var(--c-border); border-radius: 99px;
  padding: 0.18rem 0.6rem;
}
.tag-suggest:hover { border-color: var(--c-accent); }
.tag-selected .tag-chip { cursor: pointer; font-size: 0.75rem; }
.tag-selected .tag-chip::after { content: " ✕"; opacity: 0.7; }

/* Locatiekeuze */
.loc-tabs { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-bottom: 0.5rem; }
.loc-tab {
  font-size: 0.72rem; cursor: pointer;
  background: var(--c-panel-2); color: var(--c-text);
  border: 1px solid var(--c-border); border-radius: 8px;
  padding: 0.3rem 0.55rem;
}
.loc-tab.active { border-color: var(--c-accent); color: var(--c-accent); }
.loc-panel { margin-bottom: 0.4rem; }
.loc-status { font-size: 0.75rem; color: var(--c-muted); margin: 0.3rem 0; }
.loc-chosen {
  font-size: 0.78rem; color: var(--c-ok);
  background: rgba(52, 211, 153, 0.08);
  border: 1px solid rgba(52, 211, 153, 0.35);
  border-radius: 8px; padding: 0.4rem 0.6rem;
}
.place-results { max-height: 150px; overflow-y: auto; margin-top: 0.3rem; }
.place-result {
  padding: 0.35rem 0.5rem; font-size: 0.8rem; cursor: pointer;
  border-radius: 6px;
}
.place-result:hover { background: var(--c-panel-2); }
.place-result .cc { color: var(--c-muted); font-size: 0.7rem; margin-left: 0.3rem; }

.form-error {
  color: var(--c-danger); font-size: 0.8rem;
  background: rgba(248, 113, 113, 0.08);
  border: 1px solid rgba(248, 113, 113, 0.35);
  border-radius: 8px; padding: 0.4rem 0.6rem;
}

/* Map-pick modus */
body.picking #map { cursor: crosshair; }
.pick-banner {
  position: fixed; top: 70px; left: 50%; transform: translateX(-50%);
  z-index: 1500;
  background: var(--c-accent-2); color: #fff;
  padding: 0.5rem 1rem; border-radius: 99px;
  font-size: 0.85rem; font-weight: 600;
  box-shadow: 0 4px 14px rgba(0,0,0,0.4);
}

/* ---- Linkerkolom: radarwidget boven het activiteitspaneel ---- */
.left-stack {
  position: fixed;
  left: 12px;
  bottom: 12px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 252px;
}

/* ---- Radarwidget (zelfde stijl als het activiteitspaneel) ---- */
.radar-panel {
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 0.55rem 0.7rem 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.radar-title {
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--c-muted);
  margin-bottom: 0.15rem;
}
.radar-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--c-text);
  text-decoration: none;
  font-size: 0.74rem;
  padding: 0.15rem 0.35rem;
  border: 1px solid transparent;
  border-radius: 99px;
  transition: border-color 0.15s;
}
.radar-link:hover { border-color: var(--c-accent); }
.radar-link .cat-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }

/* ---- Mobiele uploadknop (FAB) ---- */
.fab-upload { display: none; }

/* ---- Weerflash-pil ---- */
.weerflash-pill {
  position: fixed;
  right: 12px;
  bottom: 30px; /* boven de Leaflet-attributie */
  z-index: 1000;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid var(--c-accent);
  border-radius: 99px;
  color: var(--c-text);
  text-decoration: none;
  font-size: 0.78rem;
  padding: 0.4rem 0.85rem;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
  transition: filter 0.15s, transform 0.1s;
}
.weerflash-pill:hover { filter: brightness(1.2); transform: translateY(-1px); }
.weerflash-pill strong { color: var(--c-accent); }
.weerflash-short { display: none; }
.weerflash-icon {
  display: inline-block;
  font-size: 1rem;
  animation: weerflash-vibrate 4s ease-in-out infinite;
}
/* korte tril elke 4 s, daartussen rust */
@keyframes weerflash-vibrate {
  0%, 8%, 100% { transform: rotate(0); }
  1% { transform: rotate(-14deg); }
  2% { transform: rotate(12deg); }
  3% { transform: rotate(-10deg); }
  4% { transform: rotate(8deg); }
  5% { transform: rotate(-5deg); }
  6% { transform: rotate(3deg); }
  7% { transform: rotate(-1deg); }
}
@media (prefers-reduced-motion: reduce) {
  .weerflash-icon { animation: none; }
}

/* ---- Bottom sheet: fotodetails op mobiel ---- */
.photo-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2500;
  background: var(--c-panel);
  border-top: 1px solid var(--c-border);
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.55);
  padding: 1rem 1rem calc(1rem + env(safe-area-inset-bottom));
  max-height: 72vh;
  overflow-y: auto;
  animation: sheet-up 0.25s ease-out;
}
@keyframes sheet-up {
  from { transform: translateY(40px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .photo-sheet { animation: none; }
}
.sheet-close {
  position: absolute;
  top: 10px;
  right: 12px;
  background: var(--c-panel-2);
  border: 1px solid var(--c-border);
  border-radius: 8px;
  color: var(--c-text);
  font-size: 0.95rem;
  line-height: 1;
  padding: 0.4rem 0.6rem;
  cursor: pointer;
  z-index: 1;
}
/* de popup-inhoud vult de sheet op volle breedte */
.photo-sheet .wf-popup { width: auto; }
/* in de sheet mag de foto wel op natuurlijke hoogte tonen */
.photo-sheet .wf-photo-wrap { height: auto; }
.photo-sheet .wf-popup img { height: auto; max-height: 46vh; }
/* in de sheet zit de sluitknop rechtsboven; het hartje wijkt uit
   naar de rechteronderhoek van de foto zodat ze nooit botsen */
.photo-sheet .like-btn { top: auto; bottom: 8px; }
.photo-sheet .wf-popup h3 { font-size: 1.05rem; padding-right: 2.2rem; }

/* ---- Galerij (masonry via CSS-kolommen) ---- */
.gallery {
  position: fixed;
  inset: 0;
  z-index: 2600;
  background: rgba(2, 6, 23, 0.97);
  overflow-y: auto;
  padding: 1rem 1.2rem 2rem;
}
.gallery-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1400px;
  margin: 0 auto 1rem;
}
.gallery-head h2 { margin: 0; font-size: 1.15rem; }
.gallery-count { font-size: 0.8rem; color: var(--c-muted); font-weight: 400; }
.gallery-controls {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}
/* iOS toont niets in een leeg datumveld; een eigen label vult dat gat */
.date-wrap { position: relative; display: inline-flex; }
#gal-date {
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: 8px;
  color: var(--c-text);
  padding: 0.28rem 0.5rem;
  font-size: 0.8rem;
  min-width: 8.5rem;
  min-height: 1.9rem;
  color-scheme: dark; /* donkere native datumkiezer */
}
.date-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  padding-left: 0.55rem;
  font-size: 0.8rem;
  color: var(--c-muted);
  pointer-events: none; /* tik gaat door naar het datumveld */
  background: var(--c-bg);
  border-radius: 8px;
}
.date-wrap.has-date .date-placeholder { display: none; }
.gallery-controls .btn:disabled { opacity: 0.35; cursor: default; }
@media (max-width: 640px) {
  .gallery-head { flex-wrap: wrap; gap: 0.5rem; }
  .gallery-controls { order: 3; width: 100%; }
}
.gallery-grid {
  max-width: 1400px;
  margin: 0 auto;
  column-count: 4;
  column-gap: 14px;
}
@media (max-width: 1200px) { .gallery-grid { column-count: 3; } }
@media (max-width: 860px)  { .gallery-grid { column-count: 2; } }
@media (max-width: 540px)  { .gallery-grid { column-count: 1; } }
.gallery-card {
  break-inside: avoid;
  margin: 0 0 14px;
  background: var(--c-panel);
  border: 1px solid var(--c-border);
  border-radius: 10px;
  overflow: hidden;
}
/* echte beeldverhouding: hoogte volgt de foto */
.gallery-photo { height: auto; border-radius: 0; }
.gallery-card img {
  width: 100%;
  height: auto;
  display: block;
  cursor: zoom-in;
}
.gallery-card figcaption {
  padding: 0.55rem 0.7rem 0.7rem;
  font-size: 0.78rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.gallery-card figcaption .meta { color: var(--c-muted); }
.gallery-to-map { align-self: flex-start; margin-top: 0.3rem; }

/* ---- Toast ---- */
.toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  z-index: 3000;
  background: var(--c-panel-2);
  border: 1px solid var(--c-accent);
  color: var(--c-text);
  padding: 0.65rem 1rem;
  border-radius: 12px;
  font-size: 0.85rem;
  line-height: 1.45;
  box-shadow: 0 4px 14px rgba(0,0,0,0.5);
  max-width: min(90vw, 440px);
}
.toast.error { border-color: var(--c-danger); }

/* ---- Admin ---- */
.admin-body { min-height: 100vh; }
.admin-login { display: flex; justify-content: center; padding: 3rem 1rem; }
.login-card {
  background: var(--c-panel);
  border: 1px solid var(--c-border);
  border-radius: 14px;
  padding: 1.5rem;
  width: 100%; max-width: 380px;
}
.login-card h2 { margin-top: 0; }
.login-hint { font-size: 0.8rem; color: var(--c-muted); }
.login-note {
  font-size: 0.75rem; color: var(--c-warn);
  background: rgba(251, 191, 36, 0.08);
  border: 1px solid rgba(251, 191, 36, 0.3);
  border-radius: 8px; padding: 0.5rem;
}
.login-card .btn { width: 100%; margin-top: 0.4rem; }

.admin-panel { padding: 1.2rem; max-width: 1100px; margin: 0 auto; width: 100%; }
.admin-section {
  background: var(--c-panel);
  border: 1px solid var(--c-border);
  border-radius: 14px;
  padding: 1.1rem;
  margin-bottom: 1.2rem;
}
.section-head h2 { margin: 0 0 0.2rem; font-size: 1.05rem; }
.section-head p { margin: 0 0 0.8rem; font-size: 0.78rem; color: var(--c-muted); }

.admin-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.admin-table th, .admin-table td {
  text-align: left; padding: 0.5rem 0.6rem;
  border-bottom: 1px solid var(--c-border);
}
.admin-table .actions-cell, .admin-table .verified-cell { white-space: nowrap; }
.admin-table th { color: var(--c-muted); font-weight: 600; font-size: 0.72rem; text-transform: uppercase; }
.status-pill { font-size: 0.7rem; border-radius: 99px; padding: 0.15rem 0.55rem; }
.status-pending  { background: rgba(251,191,36,0.15); color: var(--c-warn); }
.status-approved { background: rgba(52,211,153,0.15); color: var(--c-ok); }
.status-blocked  { background: rgba(248,113,113,0.15); color: var(--c-danger); }

.photo-filter { display: flex; gap: 1rem; font-size: 0.8rem; margin-bottom: 0.8rem; color: var(--c-muted); }
.admin-photos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.8rem;
}
.admin-photo-card {
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: 10px;
  overflow: hidden;
}
.admin-photo-card img { width: 100%; height: 120px; object-fit: cover; display: block; }
.admin-photo-card .body { padding: 0.5rem 0.6rem; font-size: 0.75rem; }
.admin-photo-card .body p { margin: 0.15rem 0; }
.admin-photo-card .muted { color: var(--c-muted); }
.admin-photo-card .actions { display: flex; gap: 0.4rem; padding: 0 0.6rem 0.6rem; }

.empty-note { color: var(--c-muted); font-size: 0.85rem; }
.pager {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-top: 0.8rem;
}
.pager-info { font-size: 0.78rem; color: var(--c-muted); }
.pager .btn:disabled { opacity: 0.35; cursor: default; }

/* ---- Lightbox (beheer): volledige foto bekijken ---- */
.admin-photo-card img { cursor: zoom-in; }
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 4000;
  background: rgba(2, 6, 23, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
}
.lightbox img {
  max-width: 94vw;
  max-height: 92vh;
  border-radius: 8px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.7);
}
.lightbox-close {
  position: fixed;
  top: 14px;
  right: 18px;
  background: none;
  border: none;
  color: #fff;
  font-size: 2.2rem;
  line-height: 1;
  cursor: pointer;
}

.hidden { display: none !important; }

@media (max-width: 640px) {
  /* Compacte topbar: één rij, icoon-knoppen */
  .topbar { padding: 0.4rem 0.6rem; gap: 0.5rem; flex-wrap: nowrap; }
  .brand { gap: 0.45rem; min-width: 0; }
  .brand-icon { font-size: 1.35rem; }
  .brand-logo { height: 28px; }
  .brand h1 {
    font-size: 0.92rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .subtitle { display: none; }
  .btn-label { display: none; }
  .topbar-actions { flex-wrap: nowrap; gap: 0.35rem; }
  .topbar-actions .btn { padding: 0.45rem 0.6rem; font-size: 1rem; line-height: 1; }
  #mode-badge { display: none; }

  /* Fototoestel uit de topbar; de FAB onderaan neemt het over */
  #btn-add-photo { display: none; }

  /* Grote uploadknop in de duimzone */
  .fab-upload {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    position: fixed;
    right: 12px;
    bottom: 34px; /* boven de kaartattributie */
    z-index: 1200;
    background: var(--c-accent-2);
    color: #fff;
    border: none;
    border-radius: 99px;
    font-size: 0.95rem;
    font-weight: 700;
    padding: 0.85rem 1.2rem;
    box-shadow: 0 6px 18px rgba(2, 132, 199, 0.55);
    cursor: pointer;
  }
  .fab-upload:active { transform: scale(0.97); }

  /* Linkerkolom: compact, panelen zo smal als hun inhoud */
  .left-stack { left: 8px; bottom: 8px; width: auto; align-items: flex-start; }
  .activity-panel { padding: 0.5rem 0.6rem 0.45rem; width: 206px; }
  .activity-panel.collapsed { width: auto; }
  .activity-panel.collapsed .range-tabs { display: none; } /* tabs pas na uitklappen */
  #ap-chart { width: 100%; height: auto; }

  /* Radars: smal paneeltje zonder titel, links onder elkaar */
  .radar-panel { padding: 0.4rem 0.55rem; gap: 0.3rem; }
  .radar-title { display: none; }
  .radar-link { font-size: 0.72rem; white-space: nowrap; padding: 0.1rem 0.2rem; }

  /* Uitgeklapt paneel: sluitknop prominent, periodetabs op eigen rij */
  .ap-head { flex-wrap: wrap; }
  .activity-panel:not(.collapsed) .range-tabs {
    order: 3;
    width: 100%;
    margin-top: 0.35rem;
  }
  .ap-toggle {
    padding: 0.4rem 0.65rem;
    font-size: 0.85rem;
    background: var(--c-panel-2);
  }

  /* Toast: nette kaart boven de knoppen i.p.v. een zwevende bol */
  .toast {
    left: 10px;
    right: 10px;
    transform: none;
    max-width: none;
    bottom: 96px;
  }

  /* Weerflash: herkenbare pil met naam, boven de uploadknop */
  .weerflash-text { display: none; }
  .weerflash-short { display: inline; font-weight: 600; font-size: 0.78rem; }
  .weerflash-pill {
    right: 12px;
    bottom: 96px;
    padding: 0.45rem 0.8rem;
  }
  .weerflash-icon { font-size: 1rem; }

  /* Uploadformulier: schermvullend en luchtig i.p.v. een kleine drukke modal */
  .modal-backdrop { padding: 0; align-items: stretch; justify-content: stretch; }
  .modal {
    max-width: none;
    max-height: none;
    height: 100%;
    border-radius: 0;
    border: none;
  }
  .modal-body { padding: 1rem 1rem 2.5rem; }
  .field { margin-bottom: 1.1rem; }
  /* 16px voorkomt dat iOS automatisch inzoomt op invoervelden */
  .field input[type="text"], .field input[type="email"],
  .field input[type="password"], .field input[type="file"],
  #place-search {
    font-size: 16px;
    padding: 0.65rem 0.7rem;
  }
  .field-row { flex-direction: column; gap: 0; }
  .photo-preview { max-height: 120px; }
  /* tagsuggesties als één horizontaal scrollbare rij */
  .tag-suggestions {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 0.25rem;
    -webkit-overflow-scrolling: touch;
  }
  .tag-suggest { flex: none; padding: 0.35rem 0.7rem; }
  .cat-pick, .loc-tab { padding: 0.45rem 0.7rem; font-size: 0.8rem; }
  .modal-footer .btn { width: 100%; padding: 0.8rem; font-size: 1rem; }
}
