body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: #f5f7fa;
  color: #222;
}

.topbar {
  background: white;
  padding: 16px;
  border-bottom: 1px solid #ddd;
}

.brand h1 {
  margin: 0 0 10px 0;
  font-size: 32px;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
}

.controls input,
.controls select,
.controls button {
  padding: 10px 12px;
  font-size: 14px;
  border: 1px solid #bbb;
  border-radius: 8px;
  box-sizing: border-box;
}

.controls input {
  min-width: 240px;
}

.controls button {
  background: white;
  cursor: pointer;
}

.controls button:hover {
  background: #f0f0f0;
}

.toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.toggle input {
  width: 18px;
  height: 18px;
  margin: 0;
}

.toggle span {
  font-size: 14px;
}

.toggle input {
  width: 18px;
  height: 18px;
}

.toggle span {
  font-size: 14px;
}

.intro,
.hint,
.note {
  font-size: 14px;
  color: #444;
  margin: 8px 0;
}

.layout {
  padding: 16px;
}

.footer {
  padding: 16px;
  font-size: 13px;
  color: #555;
}
/* Basis layout */
#mapWrap{
  width: 100%;
  height: 600px; /* vaste hoogte zodat de kaart altijd zichtbaar is */
  position: relative;
}

#map{
  width: 100%;
  height: 100%;
}

#printHeader{
  display: none;
}


/* ================== PRINT (SCHOON) ================== */
@media print {

    /* kaart netjes centreren op A4 */
#mapWrap {
  width: 100% !important;
  height: 240mm !important;
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
}

#map {
  width: 100% !important;
  height: 100% !important;
}

/* pagina schoon */
html, body {
  margin: 0 !important;
  padding: 0 !important;
  background: white !important;
}

    @media print {
  #mapWrap {
    width: 100% !important;
    height: 240mm !important;   /* staand */
    max-height: 240mm !important;
  }

  #map {
    width: 100% !important;
    height: 100% !important;
  }
}
    
  @page { margin: 10mm; } /* orientatie komt uit je dropdown via JS (@page size) */

  /* verberg alles behalve printHeader + map */
  .controls, .hint, .footer { display: none !important; }

  /* verberg Leaflet knoppen + attribution (wereldbol/link) */
  .leaflet-control-container { display: none !important; }
  .leaflet-control-attribution { display: none !important; }

  /* header wél tonen */
  #printHeader { display: block !important; margin: 0 0 6mm 0 !important; }
  #printHeader h2 { margin: 0 !important; font-size: 20px !important; }
  #printDate { margin-top: 2mm !important; font-size: 12px !important; color: #555 !important; }

  /* map layout: 1 pagina */
  html, body { margin: 0 !important; padding: 0 !important; overflow: hidden !important; background: #fff !important; }
  main, .layout { height: auto !important; }

  /* mapwrap (LET OP: jouw id is mapwrap, niet mapWrap) */
  #mapWrap {
    position: relative !important;
    overflow: hidden !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
    border: none !important;
    box-shadow: none !important;
    background: #fff !important;
  }

  #map {
    width: 100% !important;
    height: 100% !important;
    background: #fff !important;
  }

  /* verberg jouw overlay/stippellijn */
  #a4overlay { display: none !important; }

  /* voorkom rare randen/schaduwen */
  * { box-shadow: none !important; }
}
#mapWrap {
  position: relative;
}


}

@media print {
  #a4overlay {
    display: none !important;
  }
}
#printLabel {
  display: none;
}

@media print {

  #printLabel {
    display: block;
    position: absolute;
    top: 8mm;
    left: 8mm;

    background: rgba(255,255,255,0.85);
    padding: 6px 10px;
    border-radius: 4px;

    font-size: 12px;
    line-height: 1.3;

    z-index: 9999;
  }

  #printPlace {
    font-weight: 700;
  }

}
/* Mobiel vriendelijk */
@media (max-width: 700px) {
  .topbar {
    padding: 10px 10px 8px;
  }

  .brand {
    justify-content: flex-start;
  }

  .topbar h1 {
    font-size: 18px;
  }

  .topbar p {
    font-size: 12px;
  }

  .controls {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .controls input,
  .controls select,
  .controls button {
    width: 100%;
    min-height: 44px;
    font-size: 16px;
  }

  .toggle {
    justify-content: flex-start;
    padding: 4px 2px;
  }

  .hint,
  .intro,
  .note {
    text-align: left;
    font-size: 12px;
  }

  #mapWrap {
    width: 100%;
    height: calc(100vh - 320px);
    min-height: 420px;
    border-radius: 12px;
  }

  .footer {
    width: 100%;
    border-radius: 12px;
    padding: 10px 12px;
  }

  #printLabel {
    font-size: 11px;
    padding: 5px 8px;
  }
}
#mapWrap {
  width: 100% !important;
  height: 240mm !important;
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
}

#map {
  width: 100% !important;
  height: 100% !important;
}

/* pagina schoon */
html, body {
  margin: 0 !important;
  padding: 0 !important;
  background: white !important;
}
@media (max-width: 700px) {
  .topbar {
    padding: 10px;
  }

  .brand {
    justify-content: flex-start;
    align-items: flex-start;
    gap: 8px;
  }

  .topbar h1 {
    font-size: 18px;
    line-height: 1.2;
  }

  .topbar p {
    font-size: 12px;
    margin-top: 2px;
  }

  .controls {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: stretch;
  }

  .controls input,
  .controls select,
  .controls button {
    width: 100%;
    min-height: 44px;
    font-size: 16px;
  }

    .controls input[type="checkbox"] {
        width: auto !important;
        min-width: 0 !important;
        }
    .controls .toggle {
        display: flex;
        align-items: center;
        gap: 6px;
        }
    
  .toggle {
    justify-content: flex-start;
    font-size: 14px;
  }

  .intro,
  .note,
  .hint {
    text-align: left;
    font-size: 12px;
    line-height: 1.4;
  }

  #mapWrap {
    height: calc(100vh - 330px);
    min-height: 420px;
    border-radius: 12px;
  }
@media (max-width: 700px) {

.controls{
flex-direction:column;
align-items:stretch;
}

.controls input,
.controls select,
.controls button{
width:100%;
font-size:16px;
min-height:44px;
}

}
 /* mobiel layout */
@media (max-width:700px){

.controls{
flex-direction:column;
align-items:stretch;
}

.controls input,
.controls select,
.controls button{
width:100%;
font-size:16px;
min-height:44px;
}

#mapWrap{
height:60vh;
}
.toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.toggle input {
  width: 18px;
  height: 18px;
  margin: 0;
}

.toggle span {
  font-size: 14px;
}
 .toggle{
display:flex;
align-items:center;
justify-content:center;
gap:8px;
}
.toggle input{
width:18px;
height:18px;
margin:0;
}
.toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.toggle input {
  width: auto !important;
  min-width: 0 !important;
  height: 18px;
  margin: 0;
  flex: 0 0 auto;
}

.toggle span {
  width: auto !important;
}
 .toggle {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
}
/* desktop: controls compact naast elkaar */
@media (min-width: 701px) {
  .controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
  }

  .controls .toggle {
    width: auto !important;
    flex: 0 0 auto;
    justify-content: flex-start;
    margin: 0;
  }

  .controls .toggle input {
    width: auto !important;
    min-width: 0 !important;
    flex: 0 0 auto;
  }

  .controls .toggle span {
    white-space: nowrap;
  }
}
/* desktop: controls compact naast elkaar */
@media (min-width: 701px) {
  .controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
  }

  .controls .toggle {
    width: auto !important;
    flex: 0 0 auto;
    justify-content: flex-start;
    margin: 0;
  }

  .controls .toggle input {
    width: auto !important;
    min-width: 0 !important;
    flex: 0 0 auto;
  }

  .controls .toggle span {
    white-space: nowrap;
  }
}
 .controls .toggle{
  display:inline-flex;
  align-items:center;
  gap:8px;
  white-space:nowrap;
  margin:0;
  padding:0;
  flex:0 0 auto;
}

.controls .toggle input{
  width:16px !important;
  height:16px !important;
  min-width:0 !important;
  margin:0;
  flex:0 0 auto;
}

.controls .toggle span{
  margin:0;
}

@media (max-width:700px){
  .controls .toggle{
    justify-content:flex-start;
  }
}
 @media (min-width:701px){
  .controls{
    display:flex;
    flex-wrap:wrap;
    align-items:center;
    gap:8px;
  }

  .controls input[type="text"]{
    width:260px;
  }

  .controls button,
  .controls select{
    width:auto;
  }
}   
/* FIX WITTE RUIMTE + CHECKBOX */

.controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.controls input[type="text"] {
  width: 260px;
}

.controls button,
.controls select {
  width: auto;
}

/* checkbox fix */
.controls label.toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: auto !important;
  flex: 0 0 auto;
  margin: 0;
  padding: 0;
}

.controls label.toggle input {
  width: 16px !important;
  height: 16px !important;
  margin: 0;
}

.controls label.toggle span {
  white-space: nowrap;
}