* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, sans-serif;
  color: #1a1a1a;
  background: #f5f5f3;
}

header {
  padding: 0.75rem 1.25rem;
  background: #1f2937;
  color: white;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}
header h1 { font-size: 1.1rem; margin: 0; white-space: nowrap; }

.stats {
  display: flex;
  gap: 1.25rem;
  font-size: 0.85rem;
  flex-wrap: wrap;
}
.stats b { font-size: 1rem; }

.favLink {
  margin-left: auto;
  color: white;
  text-decoration: none;
  font-size: 0.85rem;
  white-space: nowrap;
}
.favLink:hover { text-decoration: underline; }

.layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  height: calc(100vh - 52px);
}

.sidebar {
  overflow-y: auto;
  border-right: 1px solid #ddd;
  background: white;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.filters {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem;
}
.filters input, .filters select {
  padding: 0.4rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 0.85rem;
}
.filters input:last-child, .filters select { grid-column: span 2; }
.checkboxLabel {
  grid-column: span 2;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: #555;
}

#typeChart { max-height: 140px; }

.list { display: flex; flex-direction: column; gap: 0.4rem; }
.listing-row {
  padding: 0.5rem;
  border: 1px solid #e5e5e5;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.8rem;
}
.listing-row:hover { background: #f0f4ff; border-color: #93c5fd; }
.listing-row .price { font-weight: 600; }
.listing-row .addr { color: #555; }
.listing-row.outOfScope { opacity: 0.5; }

main { position: relative; }
#map { height: 100%; width: 100%; }

.legend {
  position: absolute;
  left: 0.75rem;
  bottom: 1.25rem;
  background: white;
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  font-size: 0.78rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  z-index: 500;
}
.legend .dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 0.35rem;
  vertical-align: middle;
}
.legend .dot.exact { background: #22c55e; border: 1.5px solid #15803d; }
.legend .dot.approx { background: #3b82f6; border: 1.5px solid #1d4ed8; }
.legend .dot.schatting { background: #f59e0b; border: 1.5px solid #b45309; }

.detail {
  position: absolute;
  right: 1rem;
  top: 1rem;
  width: 320px;
  max-height: calc(100% - 2rem);
  overflow-y: auto;
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  padding: 1rem;
  z-index: 1000;
}
.detail.hidden { display: none; }
.detail .close {
  position: absolute;
  top: 0.4rem;
  right: 0.6rem;
  border: none;
  background: none;
  font-size: 1.3rem;
  cursor: pointer;
  color: #666;
}
.interesseSlot { position: absolute; top: 0.35rem; right: 2.4rem; }
.detail img { width: 100%; border-radius: 6px; margin-bottom: 0.5rem; }
.detail h2 { font-size: 0.95rem; margin: 0 0 0.4rem; }
.detail .price { font-size: 1.2rem; font-weight: 700; color: #1f2937; }
.detail dl { display: grid; grid-template-columns: auto 1fr; gap: 0.2rem 0.6rem; font-size: 0.82rem; margin: 0.5rem 0; }
.detail dl dt { color: #666; }
.detail a.url { display: inline-block; margin-top: 0.4rem; font-size: 0.82rem; }

.ledenSectie { margin: 0.6rem 0; padding: 0.5rem; background: #f8fafc; border-radius: 6px; }
.ledenSectie h3 { font-size: 0.82rem; margin: 0 0 0.4rem; }
.lidRow { display: flex; align-items: center; gap: 0.4rem; font-size: 0.78rem; padding: 0.15rem 0; }
.lidRow .lidPrijs { font-weight: 600; }
.lidRow .lidAgency { color: #555; flex: 1; }
.lidRow.verdwenen { opacity: 0.5; }
.lidRow .lidStatus { font-size: 0.7rem; background: #fca5a5; color: #7f1d1d; padding: 0.05rem 0.35rem; border-radius: 999px; }
.lidRow a { color: #3b82f6; text-decoration: none; }

.favGrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  padding: 1.25rem;
}
.favGrid .empty { grid-column: 1 / -1; color: #666; }

.favCard {
  position: relative;
  background: white;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.favCard img { width: 100%; height: 160px; object-fit: cover; display: block; }
.favCard h3 { font-size: 0.9rem; margin: 0.6rem 0.75rem 0.2rem; }
.favCard .price { font-weight: 700; margin: 0 0.75rem; }
.favCard .addr { color: #666; font-size: 0.8rem; margin: 0.2rem 0.75rem 0.6rem; }
.favCard dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.15rem 0.6rem;
  font-size: 0.78rem;
  margin: 0.5rem 0.75rem;
}
.favCard dl dt { color: #888; }
.favCard dl dd { margin: 0; }
.favCard a.url { display: block; margin: 0 0.75rem 0.75rem; font-size: 0.82rem; }
.favCard .interesseSlot { position: absolute; top: 0.4rem; right: 0.5rem; background: white; border-radius: 999px; padding: 0.15rem; box-shadow: 0 1px 4px rgba(0,0,0,0.2); }
.favCard .badge {
  position: absolute;
  top: 0.4rem;
  left: 0.5rem;
  background: #f59e0b;
  color: white;
  font-size: 0.7rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
}

.reviewList {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.25rem;
  max-width: 900px;
  margin: 0 auto;
}
.reviewList .empty { color: #666; text-align: center; }

.reviewRow {
  background: white;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  padding: 1rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.matchPair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.matchCard img { width: 100%; height: 140px; object-fit: cover; border-radius: 6px; }
.matchCard h4 { font-size: 0.88rem; margin: 0.4rem 0 0.15rem; }
.matchCard .price { font-weight: 700; }
.matchCard .meta { font-size: 0.78rem; color: #666; margin-top: 0.1rem; }
.matchCard a.url { display: inline-block; margin-top: 0.3rem; font-size: 0.8rem; }

.reasons {
  margin-top: 0.75rem;
  padding: 0.6rem 0.75rem;
  background: #f8fafc;
  border-radius: 6px;
  font-size: 0.8rem;
}
.reasonsTitle { font-weight: 700; margin-bottom: 0.3rem; }
.reasonLine { display: flex; gap: 0.5rem; padding: 0.1rem 0; }
.reasonLabel { color: #666; width: 90px; flex-shrink: 0; }
.reasonPoints { margin-left: auto; color: #3b82f6; font-weight: 600; }

.zekereMatchBadge { margin-top: 0.6rem; padding: 0.4rem 0.6rem; border-radius: 6px; font-size: 0.8rem; font-weight: 600; background: #dcfce7; color: #15803d; }
.zekereMatchBadge.verdacht { background: #fee2e2; color: #b91c1c; }

.interesseButtons { display: inline-flex; gap: 0.35rem; }
.interesseBtn {
  border: 1px solid #ddd;
  background: white;
  border-radius: 6px;
  width: 2rem;
  height: 2rem;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  color: #888;
}
.interesseBtn:hover { border-color: #999; }
.interesseFav.active { color: #e11d48; border-color: #e11d48; background: #fff1f2; }
.interesseAfwijzen.active { color: #b91c1c; border-color: #b91c1c; background: #fee2e2; }

.afgewezenToolbar { display: flex; align-items: center; gap: 1rem; padding: 0.75rem 1.25rem; background: white; border-bottom: 1px solid #e5e5e5; }
.afgewezenCheckboxLabel { position: absolute; top: 0.4rem; left: 0.5rem; z-index: 1; background: white; border-radius: 4px; padding: 0.1rem; box-shadow: 0 1px 4px rgba(0,0,0,0.2); }
.afgewezenCheckbox { width: 1.1rem; height: 1.1rem; cursor: pointer; }

.spreidingBlock { margin: 0.4rem 0.75rem; }
.spreidingBlock .verschil { font-weight: 700; color: #dc2626; font-size: 0.9rem; }
.spreidingLinks { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0 0.75rem 0.75rem; }
.spreidingLinks a { font-size: 0.78rem; color: #3b82f6; text-decoration: none; }

.reviewActions { display: flex; gap: 0.6rem; margin-top: 0.75rem; }
.btn {
  padding: 0.5rem 1rem;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
}
.btn.accept { background: #22c55e; color: white; }
.btn.accept:hover { background: #16a34a; }
.btn.reject { background: #ef4444; color: white; }
.btn.reject:hover { background: #dc2626; }

.clusterCard {
  background: #fffbeb;
  border: 1.5px solid #fbbf24;
  border-radius: 8px;
  padding: 1rem;
  max-width: 900px;
  margin: 0 auto 1rem;
}
.clusterCard h3 { margin: 0 0 0.6rem; font-size: 0.95rem; }
.clusterChips { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.5rem; }
.clusterChip {
  width: 90px;
  font-size: 0.7rem;
  text-align: center;
}
.clusterChip img { width: 100%; height: 60px; object-fit: cover; border-radius: 4px; }
.clusterChip .chipAgency { color: #666; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.clusterChip .chipPrijs { font-weight: 600; }
.clusterDetails { margin-top: 0.75rem; display: flex; flex-direction: column; gap: 0.75rem; }
.clusterDetails.hidden { display: none; }
.btn:not(.accept):not(.reject) { background: #e5e7eb; color: #333; }

.kansenFilters {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0.75rem 1.25rem;
  background: white;
  border-bottom: 1px solid #e5e5e5;
}
.kansenFilters label { display: flex; align-items: center; gap: 0.4rem; font-size: 0.85rem; color: #444; }
.kansenFilters input[type="number"] { width: 5rem; padding: 0.3rem; border: 1px solid #ccc; border-radius: 4px; }

.kansenList { display: flex; flex-direction: column; gap: 0.75rem; padding: 1.25rem; max-width: 900px; margin: 0 auto; }
.kansenList .empty { color: #666; text-align: center; }

.kansenCard {
  position: relative;
  display: flex;
  gap: 1rem;
  background: white;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  padding: 0.75rem;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.kansenCard:hover { border-color: #3b82f6; }
.kansenCard img { width: 140px; height: 105px; object-fit: cover; border-radius: 6px; flex-shrink: 0; }
.kansenRank { position: absolute; top: 0.5rem; left: 0.5rem; background: #1f2937; color: white; font-size: 0.75rem; font-weight: 700; padding: 0.1rem 0.45rem; border-radius: 999px; }
.kansenCard .kansenInteresse { top: 0.5rem; right: 0.5rem; background: white; border-radius: 999px; padding: 0.15rem; box-shadow: 0 1px 4px rgba(0,0,0,0.15); }
.kansenBody { flex: 1; min-width: 0; }
.kansenBody h3 { margin: 0 0 0.15rem; font-size: 0.92rem; }
.kansenTotaal { font-weight: 700; color: #3b82f6; font-size: 0.9rem; }
.kansenMeta { display: flex; flex-wrap: wrap; gap: 0.6rem; font-size: 0.78rem; color: #555; margin: 0.3rem 0; }
.kansenMeta .onderMediaan { color: #16a34a; font-weight: 600; }
.kansenMeta .bovenMediaan { color: #dc2626; }

.kansenBars { display: flex; flex-direction: column; gap: 0.15rem; margin-top: 0.4rem; max-width: 320px; }
.kansenBar { display: grid; grid-template-columns: 60px 1fr 2rem; align-items: center; gap: 0.4rem; font-size: 0.7rem; color: #666; }
.kansenBar.leeg { opacity: 0.5; }
.kansenBarTrack { background: #e5e7eb; border-radius: 999px; height: 6px; overflow: hidden; }
.kansenBarFill { background: #3b82f6; height: 100%; }
.kansenBarValue { text-align: right; }

.kansenVlag { margin-top: 0.4rem; font-size: 0.75rem; color: #b45309; }
.kansenMotivatie { margin-top: 0.4rem; font-size: 0.78rem; color: #444; font-style: italic; }
.kansenMotivatie.leeg { color: #999; font-style: normal; }

.locatieBadge {
  display: inline-block;
  font-size: 0.75rem;
  color: #444;
  background: #f8fafc;
  border-radius: 6px;
  padding: 0.35rem 0.5rem;
  margin: 0.4rem 0;
}
.locatieBadge .herkomst { display: block; color: #777; margin-top: 0.15rem; }
.correctAddressBtn {
  display: inline-block;
  margin: 0.2rem 0 0.4rem;
  font-size: 0.78rem;
  background: none;
  border: 1px solid #ccc;
  border-radius: 999px;
  padding: 0.2rem 0.6rem;
  cursor: pointer;
  color: #333;
}
.correctAddressBtn:hover { background: #f0f4ff; border-color: #93c5fd; }

.modalOverlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}
.modalOverlay.hidden { display: none; }
.modal {
  position: relative;
  background: white;
  border-radius: 8px;
  padding: 1.25rem;
  width: 380px;
  max-width: 90vw;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
}
.modal h3 { margin: 0 0 0.75rem; font-size: 1rem; }
.correctTabs { display: flex; gap: 0.3rem; margin-bottom: 0.75rem; }
.correctTab {
  flex: 1;
  padding: 0.35rem;
  border: 1px solid #ccc;
  background: #f5f5f3;
  border-radius: 6px;
  font-size: 0.78rem;
  cursor: pointer;
}
.correctTab.active { background: #3b82f6; color: white; border-color: #1d4ed8; }
.correctFields { display: flex; gap: 0.4rem; margin-bottom: 0.6rem; }
.correctFields.hidden { display: none; }
.correctFields input {
  flex: 1;
  padding: 0.4rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 0.85rem;
  min-width: 0;
}
#correctMiniMap { height: 200px; border-radius: 6px; margin-bottom: 0.4rem; }
.correctPreviewLabel { font-size: 0.78rem; color: #555; min-height: 1.2rem; margin-bottom: 0.4rem; }
.correctPreviewLabel.error { color: #dc2626; }

.dkWrap { display: flex; flex-direction: column; gap: 1rem; padding: 1.25rem; max-width: 700px; margin: 0 auto; }
.dkCard {
  background: white;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  padding: 1rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.dkCard h2 { font-size: 0.95rem; margin: 0 0 0.6rem; }
.dkHint { font-size: 0.8rem; color: #666; margin: -0.3rem 0 0.6rem; }
.dkBarRow { display: grid; grid-template-columns: 180px 1fr 90px; align-items: center; gap: 0.5rem; font-size: 0.8rem; margin: 0.3rem 0; }
.dkBarTrack { background: #e5e7eb; border-radius: 999px; height: 10px; overflow: hidden; }
.dkBarFill { height: 100%; }
.dkBarValue { text-align: right; color: #555; }
.dkTable { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.dkTable td { padding: 0.3rem 0.2rem; border-bottom: 1px solid #f0f0f0; }
.dkTable .dkNum { text-align: right; font-weight: 600; }
.dkCandList { display: flex; flex-direction: column; gap: 0.3rem; }
.dkCandRow {
  display: flex;
  gap: 0.6rem;
  padding: 0.4rem 0.5rem;
  border: 1px solid #eee;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.8rem;
}
.dkCandRow:hover { background: #f0f4ff; border-color: #93c5fd; }
.dkCandPrijs { font-weight: 600; min-width: 5rem; }
.dkCandAdres { flex: 1; color: #444; }
.dkCandWijk { color: #888; }

.lbWrap { display: flex; justify-content: center; padding: 1.25rem; }
.lbCard {
  background: white;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  padding: 1.25rem;
  max-width: 800px;
  width: 100%;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.lbCard h2 { margin: 0 0 0.4rem; font-size: 1.1rem; }
.lbTitleRow { display: flex; justify-content: space-between; align-items: flex-start; gap: 0.75rem; }
.lbTitleRow h2 { flex: 1; }
.lbInteresse { position: static; flex-shrink: 0; }
.lbCard h3 { font-size: 0.9rem; margin: 1rem 0 0.5rem; color: #444; }
.lbMeta { display: flex; gap: 1rem; font-size: 0.85rem; color: #555; margin-bottom: 0.4rem; flex-wrap: wrap; }
.lbMeta .price { font-weight: 700; color: #1f2937; }
.lbCard a.url { font-size: 0.82rem; display: inline-block; margin-bottom: 0.5rem; }
.lbHint { background: #fffbeb; border: 1px solid #fbbf24; border-radius: 6px; padding: 0.5rem 0.7rem; font-size: 0.85rem; margin: 0.5rem 0; }
.lbVisionHint { background: #eff6ff; border-color: #93c5fd; }
.lbVisionBox { margin: 0.5rem 0; }
.lbOordeel { display: inline-block; font-weight: 700; font-size: 0.9rem; padding: 0.3rem 0.7rem; border-radius: 999px; margin: 0.4rem 0 0.2rem; }
.lbOordeelMatch { background: #dcfce7; color: #15803d; }
.lbOordeelTwijfel { background: #fef3c7; color: #b45309; }
.lbOordeelGeenMatch { background: #fee2e2; color: #b91c1c; }
.lbCompareMotivatie { font-size: 0.82rem; color: #444; margin: 0.2rem 0 0.5rem; }
.lbPhotoViewer { margin: 0.5rem 0; }
.lbMainPhoto { width: 100%; max-height: 440px; object-fit: cover; border-radius: 8px; cursor: zoom-in; display: block; background: #eee; }
.lbThumbStrip { display: flex; gap: 0.4rem; overflow-x: auto; margin-top: 0.4rem; padding-bottom: 0.2rem; }
.lbThumb { width: 84px; height: 62px; object-fit: cover; border-radius: 4px; cursor: pointer; opacity: 0.6; flex-shrink: 0; border: 2px solid transparent; }
.lbThumb:hover { opacity: 0.9; }
.lbThumb.active { opacity: 1; border-color: #3b82f6; }
.lbLightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3000;
  cursor: zoom-out;
}
.lbLightbox img { max-width: 92vw; max-height: 92vh; object-fit: contain; border-radius: 4px; }
.lbEmbeds { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.lbEmbedFrame { width: 100%; height: 320px; border: none; border-radius: 6px; }
.lbDescription { font-size: 0.82rem; color: #555; margin-top: 1rem; white-space: pre-line; }
