:root { --bg: #f5f2ea; --card: #fff; --ink: #1f2a1f; --muted: #6b6f66; --line: #e6e1d5; --accent: #2e6b3a; --gold: #d9b45a; --g: #2e7d32; --o: #ef8a00; --r: #c62828; }
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--ink); }
a { color: var(--accent); }
h1, h2 { line-height: 1.2; }
input, select, textarea { font: inherit; padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: inherit; }
textarea { resize: vertical; width: 100%; }
table { border-collapse: collapse; width: 100%; }
th { text-align: left; font-weight: 600; }
details summary { cursor: pointer; font-weight: 600; }

header.top { position: sticky; top: 0; z-index: 1000; display: flex; align-items: center; gap: 14px; padding: 9px 18px; background: #24452b; color: #fff; flex-wrap: wrap; }
header.top a { color: #fff; text-decoration: none; }
.brand { font-weight: 700; font-size: 17px; }
nav { display: flex; gap: 4px; align-items: center; flex: 1; flex-wrap: wrap; }
nav a { padding: 6px 10px; border-radius: 8px; opacity: .85; }
nav a.on, nav a:hover { background: rgba(255,255,255,.14); opacity: 1; }
.me { font-size: 13px; opacity: .9; }
main { max-width: 1280px; margin: 0 auto; padding: 18px; }
main.full { max-width: none; padding: 0; }

.btn { background: var(--gold); color: var(--ink) !important; border: 0; border-radius: 8px; padding: 8px 14px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn.small { padding: 5px 10px; font-size: 13px; }
.btn.ghost { background: transparent; border: 1px solid var(--line); }
.btn:disabled { opacity: .5; cursor: default; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.err { color: var(--r); }
.center { text-align: center; padding: 60px 20px; }
.narrow { max-width: 760px; margin: 0 auto; }
.pre { white-space: pre-wrap; }
.note { background: #fff7e0; border: 1px solid #f0d58c; padding: 10px 12px; border-radius: 10px; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 3px 0; }
.note.row { padding: 10px 12px; } /* .row zou de binnenmarge van de melding anders wegnemen */
.badge { background: var(--gold); color: var(--ink); border-radius: 999px; padding: 0 7px; font-size: 12px; font-weight: 700; }
label { display: flex; flex-direction: column; gap: 4px; margin: 10px 0; font-weight: 600; }
label.check { flex-direction: row; align-items: center; gap: 6px; margin: 0; font-weight: 400; font-size: 14px; }

.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 6px; }
.filters input[type=search] { flex: 1 1 220px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.card { background: var(--card); border-radius: 14px; box-shadow: 0 1px 3px rgba(0,0,0,.08); overflow: hidden; }
.house { display: flex; flex-direction: column; color: inherit; text-decoration: none; transition: transform .1s, box-shadow .1s; }
.house:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0,0,0,.12); }
.thumb { position: relative; aspect-ratio: 3/2; background: #ddd8cb; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.nofoto { display: grid; place-items: center; height: 100%; color: var(--muted); }
.rank { position: absolute; left: 10px; top: 10px; background: #24452b; color: #fff; font-weight: 700; border-radius: 50%; width: 30px; height: 30px; display: grid; place-items: center; }
.tag { position: absolute; top: 10px; right: 10px; background: var(--gold); border-radius: 6px; padding: 2px 8px; font-size: 12px; font-weight: 600; }
.tag.phase { top: auto; bottom: 10px; background: #24452b; color: #fff; }
.body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; }
.price { font-weight: 700; font-size: 17px; }
.pill { font-size: 12px; background: #f3e3c3; color: #6b4a00; border-radius: 6px; padding: 1px 6px; font-weight: 600; vertical-align: middle; }
.facts { font-size: 13px; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 4px; }
.chip { font-size: 11.5px; padding: 2px 7px; border-radius: 999px; border: 1px solid; }
.v2 { background: #e5f2e6; border-color: #9cc9a0; color: #1b5e20; }
.v1 { background: #fff3df; border-color: #f0c27a; color: #8a5200; }
.v0 { background: #fbe9e9; border-color: #e8a5a5; color: #8e1c1c; }
.vx { background: #f1f1ef; border-color: #ddd; color: #888; border-style: dashed; }
.score { font-size: 12px; font-weight: 700; background: #24452b; color: #fff; border-radius: 999px; padding: 2px 8px; }
.stars { display: inline-flex; }
.stars button { background: none; border: 0; padding: 0 1px; font-size: 21px; color: #d6d0c0; cursor: pointer; line-height: 1; }
.stars button.on { color: #e0a800; }
.stars button:hover { transform: scale(1.15); }
.stars.ro { color: #e0a800; letter-spacing: 1px; }
.stars.ro .off { color: #d6d0c0; }

.detail .head { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; flex-wrap: wrap; }
.detail h1 { margin: 6px 0 2px; font-size: 26px; }
.price.big { font-size: 26px; text-align: right; }
.price.big .small { font-weight: 500; }
.photos { display: flex; gap: 8px; overflow-x: auto; padding: 8px 0 10px; scroll-snap-type: x mandatory; }
.photos img { height: 150px; border-radius: 10px; scroll-snap-align: start; display: block; cursor: zoom-in; }
.photos img.plan { background: #fff; border: 1px solid var(--line); }
.detail > .facts { margin-bottom: 14px; font-size: 14px; }
.cols { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 860px) {
  .cols { grid-template-columns: minmax(0, 1fr); } /* minmax(0, …): een brede tabel mag de kolom niet breder dan het scherm maken */
  .detail .cols { gap: 0; } /* één kolom: notities direct na familie en match, niet pas onder de koopberekening */
  .detail .cols > div { display: contents; }
  .detail .cols > div:first-child > :nth-child(n+3), .detail .cols > div:last-child > * { order: 2; }
  .detail .cols > div > .thread { order: 1; }
  .dist td[colspan] { white-space: normal; }
}
.box { background: var(--card); border-radius: 14px; padding: 14px 16px; box-shadow: 0 1px 3px rgba(0,0,0,.06); margin-bottom: 16px; }
.box h3 { margin: 0 0 10px; font-size: 16px; display: flex; gap: 8px; align-items: center; }
.crit td, .crit th, .dist td, .dist th, .kv td, .kv th { padding: 5px 6px; border-top: 1px solid var(--line); vertical-align: top; font-size: 14px; }
.crit th { white-space: nowrap; }
.dist td { text-align: right; white-space: nowrap; }
.dot { width: 16px; }
.dot::before { content: ''; display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-top: 4px; }
.d2::before { background: var(--g); } .d1::before { background: var(--o); } .d0::before { background: var(--r); } .dx::before { background: #ccc; }

.map { height: calc(100vh - 54px); } /* terugval voor browsers zonder :has() */
#app:has(> main.full) { display: flex; flex-direction: column; height: 100vh; height: 100dvh; } /* kaartpagina: de kaart krijgt wat de kopbalk overlaat */
#app:has(> main.full) > main { flex: 1; min-height: 0; width: 100%; } /* width: margin auto zou main anders smal maken */
#app:has(> main.full) .mapwrap, #app:has(> main.full) .map { height: 100%; }
.map.small { height: 340px; border-radius: 14px; margin-bottom: 16px; }
.leaflet-container { background: #e9e6df; }
.mapwrap { position: relative; }
.paneltoggle { position: absolute; top: 12px; right: 12px; z-index: 700; box-shadow: 0 2px 6px rgba(0,0,0,.25); }
.mappanel { position: absolute; top: 52px; right: 12px; z-index: 650; width: 280px; max-height: calc(100% - 64px); overflow-y: auto; background: rgba(255,255,255,.97); border-radius: 12px; padding: 10px 14px 14px; box-shadow: 0 2px 12px rgba(0,0,0,.25); display: flex; flex-direction: column; gap: 6px; }
.mappanel h3 { margin: 8px 0 2px; font-size: 14px; }
.mappanel select { width: 100%; }
.seg { display: flex; gap: 4px; }
.seg button { flex: 1; border: 1px solid var(--line); background: #fff; border-radius: 6px; padding: 5px 2px; font: inherit; font-size: 12.5px; cursor: pointer; }
.seg button.on { background: #24452b; border-color: #24452b; color: #fff; }
.legend { display: flex; flex-direction: column; gap: 3px; font-size: 12.5px; }
.legend i { display: inline-block; width: 11px; height: 11px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.legend i.ln { width: 16px; height: 3px; border-radius: 0; }
/* woningen: duidelijke gekleurde pinnen, getal = match, ster = familiecijfer */
.hm { background: none; border: 0; }
.hm .pin { position: relative; box-sizing: border-box; width: 100%; height: 100%; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 2px 7px rgba(0,0,0,.6); color: #fff; font: 700 12px/28px -apple-system, BlinkMacSystemFont, sans-serif; text-align: center; text-shadow: 0 1px 2px rgba(0,0,0,.6); }
.hm .pin.focus { border-color: #111; font-size: 14px; line-height: 36px; }
.hm .pin.gone { opacity: .45; filter: grayscale(.7); }
.hm .pin .r { position: absolute; top: -10px; right: -16px; background: #ffd54f; color: #3e2723; border: 1.5px solid #fff; border-radius: 8px; padding: 0 4px; font-size: 10.5px; line-height: 15px; text-shadow: none; white-space: nowrap; }
/* werk en vaste punten */
.poi-l { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; background: #fff; border: 2px solid #24452b; border-radius: 16px; padding: 1px 9px 1px 4px; font: 600 12.5px/20px -apple-system, BlinkMacSystemFont, sans-serif; color: #1f2a1f; box-shadow: 0 2px 5px rgba(0,0,0,.35); }
.poi-l span { font-size: 15px; }
/* stations: stip, naam en minuten naar Zwolle pas bij inzoomen */
.st { display: flex; align-items: center; gap: 3px; white-space: nowrap; }
.st i { flex: none; width: 8px; height: 8px; border-radius: 50%; background: #fff; border: 2.5px solid #263238; }
.st span { font: 600 11px/1.3 -apple-system, BlinkMacSystemFont, sans-serif; color: #263238; background: rgba(255,255,255,.88); padding: 1px 4px; border-radius: 4px; }
.lowzoom .st span { display: none; }
.mini { display: block; color: inherit; text-decoration: none; width: 230px; }
.mini img { width: 100%; border-radius: 8px; margin-bottom: 4px; }

.comment { border-top: 1px solid var(--line); padding: 8px 0; }
.comment.reply { margin-left: 18px; border-top: 1px dashed var(--line); }
.comment p { margin: 4px 0; }
.actions a { margin-right: 10px; }
.cform { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.tl { display: grid; grid-template-columns: 140px 1fr; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.ev.prijs, .ev.status { font-weight: 600; }

.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.pad { padding: 30px; max-width: 420px; text-align: center; display: flex; flex-direction: column; gap: 12px; align-items: center; }
.logo { font-size: 52px; }
.voorstel, .metknop { display: flex; flex-direction: column; gap: 6px; }
.voorstel > .row, .metknop > .row { padding: 0 4px; }
.hm .pin.sug { border-style: dashed; box-shadow: 0 0 0 3px #8e24aa, 0 2px 7px rgba(0,0,0,.6); }
.pos { color: var(--g); font-weight: 600; } .neg { color: var(--r); font-weight: 600; }
.koop tr.sub td { color: var(--muted); font-size: 13px; padding-left: 18px; border-top: 0; }
.koop tr.tot th, .koop tr.tot td, .dist tr.tot th, .dist tr.tot td { border-top: 2px solid var(--ink); font-weight: 700; }
.koop tr.opt th, .koop tr.opt td { color: var(--muted); font-style: italic; }
.tablewrap { overflow-x: auto; background: var(--card); border-radius: 14px; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.koopt th, .koopt td { padding: 8px 10px; border-top: 1px solid var(--line); text-align: right; white-space: nowrap; font-size: 14px; }
.koopt th:first-child, .koopt td:first-child { text-align: left; white-space: normal; }
:is(.koopt, .koop) th[title] { text-decoration: underline dotted; text-underline-offset: 3px; cursor: help; } /* uitleg bij aanwijzen */
.koopedit input { max-width: 260px; } .koopedit input[type=number] { max-width: 130px; } .koopedit h4 { margin: 12px 0 4px; }
.mappanel i.zone { display: inline-block; width: 12px; height: 12px; border-radius: 3px; opacity: .6; margin-right: 2px; vertical-align: middle; }
.mapwrap.small { margin-bottom: 16px; }
.mapwrap.small .map.small { height: 420px; margin-bottom: 0; }
.mapwrap.small .paneltoggle { top: 10px; right: 10px; }
.mapwrap.small .mappanel { top: 48px; right: 10px; width: 250px; max-height: calc(100% - 58px); }
.lightbox { position: fixed; inset: 0; z-index: 3000; background: rgba(0,0,0,.93); display: flex; align-items: center; justify-content: center; }
.lightbox img { max-width: 94vw; max-height: 86vh; object-fit: contain; box-shadow: 0 4px 30px rgba(0,0,0,.6); }
.lightbox img.plan { background: #fff; }
.lb { position: absolute; background: rgba(255,255,255,.16); color: #fff; border: 0; font-size: 34px; width: 54px; height: 54px; border-radius: 50%; cursor: pointer; line-height: 1; }
.lb:hover { background: rgba(255,255,255,.32); }
.lb.prev { left: 16px; top: 50%; transform: translateY(-50%); }
.lb.next { right: 16px; top: 50%; transform: translateY(-50%); }
.lb.close { top: 14px; right: 16px; font-size: 22px; width: 44px; height: 44px; }
.lbcount { position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%); color: #fff; font-size: 14px; background: rgba(0,0,0,.45); padding: 4px 12px; border-radius: 10px; }
.koop tr.sub td { vertical-align: top; }
.koop .postfoto { width: 84px; height: 56px; object-fit: cover; border-radius: 6px; cursor: zoom-in; }
.koop .hoe { color: var(--muted); font-size: 12.5px; margin-top: 2px; white-space: normal; }
.koop td { white-space: normal; }
.koop label.kies { display: flex; gap: 8px; align-items: flex-start; flex-direction: row; margin: 0; font-weight: 400; cursor: pointer; }
.koop label.kies input { margin-top: 4px; flex: none; }
.koop label.kies .postfoto { float: none; flex: none; }
.koop .hoe { display: block; }
.leaflet-image-layer.overlap { image-rendering: auto; }
.koop tr.sub td:first-child, .koop tr.sub td[colspan] { text-align: left; }
.koop td:last-child { white-space: nowrap; vertical-align: top; }
.koop .figs { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0 2px 24px; }
.koop .figs:empty { display: none; }
.koop tr.groep td { padding: 12px 0 2px 18px; font-size: 13px; font-weight: 600; border-top: 0; text-align: left; }
.koop td[colspan] { white-space: normal; } /* toelichtingsregels mogen afbreken, anders wordt de tabel breder dan het blok */

/* ---------- telefoon: kleine kopbalk, navigatie als balk onderin, filters ingeklapt */
nav a i { display: none; font-style: normal; } /* iconen alleen in de balk onderin */
.filters .meer, .touch { display: none; }
@media (max-height: 500px) { header.top { position: static; } } /* telefoon liggend: een vaste kopbalk van twee regels laat te weinig over */
@media (max-width: 1200px) { /* tablet en kleine laptop: per maand en over/tekort moeten in beeld blijven */
  .koopt :is(th, td):is(:nth-child(3), :nth-child(4), :nth-child(9)) { display: none; }
  .koopt td:nth-child(5) .small { display: block; } /* schatting onder het bedrag: ruimte voor de kolom per maand */
  .koopt th { white-space: normal; }
}
@media (pointer: coarse) {
  input, select, textarea { font-size: 16px; } /* onder 16px zoomt iOS in zodra je een veld aantikt, ook in liggende stand */
  .touch { display: block; margin: 6px 2px 0; }
  .stars button { font-size: 30px; padding: 0 3px; } /* grote sterren: wie ernaast tikt, opent anders de woning */
  .actions a { display: inline-block; padding: 6px 0; margin-right: 26px; } /* Reageer en Verwijder niet vlak naast elkaar */
}
@media (max-width: 760px) {
  header.top { position: static; flex-wrap: nowrap; gap: 10px; padding: 8px 12px; }
  .brand { flex: 1; min-width: 0; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .me { display: none; } /* uitloggen staat op Familie */
  nav { position: fixed; z-index: 1100; left: 0; right: 0; bottom: 0; flex-wrap: nowrap; gap: 0; background: #24452b; box-shadow: 0 -1px 6px rgba(0,0,0,.25); }
  nav a { position: relative; flex: 1 1 0; min-width: 0; height: 56px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 0; border-radius: 0; font-size: 11px; line-height: 1.25; }
  nav a i { display: block; font-size: 21px; line-height: 1.2; }
  nav a .badge { position: absolute; top: 3px; left: calc(50% + 7px); font-size: 10.5px; padding: 0 5px; }
  main { padding: 12px 12px 72px; } /* ruimte voor de balk onderin */
  main.full { padding: 0 0 56px; }
  .box { padding: 12px; }
  .row { flex-wrap: wrap; }
  .filters .meer { display: inline-block; }
  .filters:not(.open) .meer ~ * { display: none; }
  .detail h1 { font-size: 22px; }
  .price.big { font-size: 22px; text-align: left; }
  .tl { grid-template-columns: 1fr; gap: 0; }
  .koopt :is(th, td):is(:nth-child(2), :nth-child(5), :nth-child(6)) { display: none; } /* opbouw en totaal staan op de woningpagina; per maand en over/tekort blijven */
  .koopt th, .koopt td { padding: 8px 6px; font-size: 13.5px; }
  .koopt td:first-child { overflow-wrap: anywhere; } /* lange straatnaam mag afbreken, anders valt over/tekort buiten beeld */
  .koopedit .row input { flex: 1 1 120px; min-width: 0; }
  .koopedit .row input[type=number] { flex: 0 0 110px; }
  .mappanel { top: auto; left: 0; right: 0; bottom: 0; width: auto; max-height: 60%; border-radius: 14px 14px 0 0; z-index: 1050; } /* boven de kaartknoppen en bronvermelding (1000), onder de balk (1100) */
  .mapwrap.small .map.small { height: 320px; }
  .mapwrap.small .mappanel { position: static; width: auto; max-height: none; margin-top: 8px; border-radius: 14px; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
  .lb { width: 44px; height: 44px; font-size: 28px; }
  .lb.prev { left: 6px; } .lb.next { right: 6px; } .lb.close { top: 10px; right: 10px; }
}
@media (max-width: 340px) { nav a { font-size: 10px; } } /* "Voorstellen" past anders net niet in een cel van 53px */
.prijsform { display: inline-flex; gap: 6px; margin-top: 6px; font-size: 14px; font-weight: 400; color: var(--ink); } /* staat in het prijsblok: niet groot en gekleurd */
.prijsform input { width: 150px; }
