* { box-sizing: border-box; }
html, body { margin:0; padding:0; height:100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Arial, sans-serif;
  background:#eef2f6;
  color:#1d2a35;
  overflow:hidden;
}
.app-header {
  position: fixed;
  top:0; left:0; right:0;
  height:60px;
  background:#0b5cab;
  color:white;
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:0 8px;
  z-index: 10000;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.header-title { flex:1; text-align:center; }
.header-title h1 { margin:0; font-size:22px; letter-spacing:0.3px; }
.icon-btn {
  background: transparent;
  border:none;
  color:white;
  width:44px; height:44px;
  border-radius:50%;
  display:flex; align-items:center; justify-content:center;
  cursor:pointer;
}
.icon-btn:hover { background: rgba(255,255,255,0.15); }
.icon-btn.small { width:36px; height:36px; color:#333; background:#f1f4f8; }
.icon-btn.small:hover { background:#e2e8ef; }
.main-fullscreen { position: fixed; top:60px; left:0; right:0; bottom:0; }
#map { width:100%; height:100%; background:#cbd5e1; }
.locate-fab {
  position:absolute;
  bottom:24px;
  right:12px;
  width:48px;
  height:48px;
  border-radius:50%;
  background:white;
  border:none;
  box-shadow:0 4px 12px rgba(0,0,0,0.25);
  display:flex;
  align-items:center;
  justify-content:center;
  color:#0b5cab;
  cursor:pointer;
  z-index:800;
}
.leaflet-bottom.leaflet-left { bottom: 8px; }
.leaflet-control-zoom {
  border-radius: 14px !important;
  overflow:hidden;
  box-shadow:0 4px 12px rgba(0,0,0,0.2) !important;
  border:none !important;
}
.map-bottom-bar {
  position:absolute;
  bottom:32px;
  left:50%;
  transform: translateX(-50%);
  z-index:800;
  background: rgba(255,255,255,0.94);
  backdrop-filter: blur(8px);
  border-radius: 999px;
  padding: 6px 16px;
  height: 36px;
  display:flex;
  align-items:center;
  gap:10px;
  box-shadow:0 4px 14px rgba(0,0,0,0.18);
  border:1px solid rgba(0,0,0,0.06);
  min-width: 280px;
  max-width: calc(100% - 140px);
}
.map-bottom-bar.hidden { display:none; }
.map-bottom-bar input[type=range] {
  -webkit-appearance:none;
  appearance:none;
  width:260px;
  height:4px;
  background:#d6dde5;
  border-radius:999px;
  outline:none;
  flex:1;
}
.map-bottom-bar input[type=range]::-webkit-slider-thumb {
  -webkit-appearance:none;
  width:16px;
  height:16px;
  border-radius:50%;
  background:#0b5cab;
  border:2px solid white;
  box-shadow:0 1px 4px rgba(0,0,0,0.25);
  cursor:pointer;
}
.map-bottom-bar input[type=range]::-moz-range-thumb {
  width:16px;
  height:16px;
  border-radius:50%;
  background:#0b5cab;
  border:2px solid white;
  box-shadow:0 1px 4px rgba(0,0,0,0.25);
  cursor:pointer;
}
.bar-divider {
  width:1px;
  height:20px;
  background:#d6dde5;
  margin:0 2px;
}
.bag-toggle-btn {
  width:28px;
  height:28px;
  border-radius:50%;
  border:none;
  background:#0b5cab;
  color:white;
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  box-shadow:0 1px 4px rgba(0,0,0,0.2);
  transition: all 0.2s;
}
.bag-toggle-btn.active {
  background:#0b5cab;
  color:white;
}
.bag-toggle-btn:not(.active) {
  background:#e5eaf0;
  color:#7a8a9a;
}
.bag-toggle-btn:active { transform: scale(0.92); }
.map-bottom-bar .value {
  font-size:11px;
  font-weight:800;
  color:#0b5cab;
  min-width:30px;
  text-align:right;
}
.status-toast {
  position:absolute;
  top:12px;
  left:50%;
  transform: translateX(-50%);
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(6px);
  padding:10px 14px;
  border-radius:999px;
  font-size:13px;
  box-shadow:0 2px 10px rgba(0,0,0,0.15);
  z-index:800;
  max-width:90%;
  text-align:center;
  border:1px solid rgba(0,0,0,0.06);
}
.overlay { position:fixed; inset:0; background: rgba(0,0,0,0.35); z-index:9998; }
.overlay.hidden { display:none; }
.side-menu {
  position:fixed; top:0; left:0; bottom:0; width:300px; max-width:85vw;
  background:white; z-index:9999; transform: translateX(-100%);
  transition: transform 0.28s ease; display:flex; flex-direction:column;
  box-shadow: 2px 0 16px rgba(0,0,0,0.2);
}
.side-menu.open { transform: translateX(0); }
.side-menu-header { height:60px; display:flex; align-items:center; justify-content:space-between; padding:0 16px; border-bottom:1px solid #e5eaf0; }
.side-menu-content { padding:16px; overflow-y:auto; flex:1; }
.menu-section { margin-bottom:22px; }
.menu-section h3 { margin:0 0 10px; font-size:14px; text-transform:uppercase; letter-spacing:0.6px; color:#5a6b7d; }
.menu-section label { font-weight:600; font-size:14px; }
.menu-section select { width:100%; margin-top:8px; padding:10px 12px; border-radius:10px; border:1px solid #c8d3df; font-size:15px; background:white; }
.menu-hint { font-size:12px; color:#6b7d8e; margin-top:8px; line-height:1.4; }
.toggle { display:flex; gap:10px; align-items:center; cursor:pointer; font-weight:500 !important; }
.toggle input {
  -webkit-appearance:none;
  appearance:none;
  width:18px;
  height:18px;
  min-width:18px;
  min-height:18px;
  flex:0 0 18px;
  margin:0;
  padding:0;
  box-sizing:border-box;
  border:1.5px solid #9aa9b8;
  border-radius:4px;
  background:#fff;
  display:inline-grid;
  place-content:center;
  cursor:pointer;
}
.toggle input:checked {
  background:#0b5cab;
  border-color:#0b5cab;
}
.toggle input:checked::after {
  content:"";
  width:8px;
  height:4px;
  border-left:2px solid #fff;
  border-bottom:2px solid #fff;
  transform:rotate(-45deg) translate(1px,-1px);
}
.toggle input:focus-visible {
  outline:2px solid rgba(11,92,171,.35);
  outline-offset:2px;
}
.modal {
  position:fixed;
  top:50%;
  left:50%;
  transform:translate(-50%,-50%);
  background:white;
  width:92%;
  max-width:420px;
  max-height:calc(100vh - 32px);
  border-radius:16px;
  box-shadow:0 20px 50px rgba(0,0,0,0.25);
  z-index:10001;
  display:flex;
  flex-direction:column;
  overflow:hidden;
}
.modal.hidden { display:none; }
.modal-header { display:flex; align-items:center; justify-content:space-between; padding:16px 16px 0 20px; }
.modal-header h2 { margin:0; font-size:18px; }
.modal-body {
  padding:16px 20px 20px;
  font-size:14.5px;
  line-height:1.5;
  color:#2f3d4a;
  flex:1 1 auto;
  min-height:0;
  overflow-y:auto;
  overflow-x:hidden;
  -webkit-overflow-scrolling:touch;
}
.modal-body p { margin:0 0 10px; }
.year-badge{
  background:#0b5cab;
  color:#fff;
  padding:3px 8px;
  border-radius:12px;
  font-size:12px;
  font-weight:700;
  line-height:1;
  min-width:44px;
  text-align:center;
  border:2px solid #fff;
  box-shadow:0 1px 4px rgba(0,0,0,.3);
  white-space:nowrap;
  display:inline-block;
}
.year-badge.very-old{ background:#7a1d1d; }
.year-badge.old{ background:#b85c00; }
.year-badge.unknown{ background:#666; }
.leaflet-control-attribution { font-size:10px; }
.leaflet-popup-content { font-size:13px; }
@media (max-width:480px){
  .map-bottom-bar { max-width: calc(100% - 110px); min-width: 200px; }
  .map-bottom-bar input[type=range] { width:140px; }
}


/* =========================================================
   Professioneel BAG / HisGIS popupvenster
   ========================================================= */
.history-popup{
  min-width:280px;
  max-width:380px;
  color:#263746;
  font-size:13px;
  line-height:1.45;
}
.history-popup-tabs{
  display:flex;
  gap:4px;
  margin:-4px -4px 12px;
  padding:4px;
  background:#f1f5f9;
  border:1px solid #dce4ec;
  border-radius:10px;
}
.history-tab{
  flex:1;
  min-height:38px;
  border:0;
  border-radius:7px;
  background:transparent;
  color:#5b6b7b;
  font-size:13px;
  font-weight:700;
  cursor:pointer;
  transition:all .18s ease;
}
.history-tab:hover{
  background:#e5edf5;
  color:#244b70;
}
.history-tab.active{
  background:#fff;
  color:#0b5cab;
  box-shadow:0 2px 7px rgba(26,55,80,.14);
}
.history-tab-icon{
  display:inline-flex;
  width:18px;
  height:18px;
  align-items:center;
  justify-content:center;
  margin-right:4px;
  font-size:14px;
}
.history-tab-panel{
  animation:historyPanelIn .16s ease-out;
  height:300px;
  min-height:300px;
  max-height:300px;
  overflow-y:auto;
  box-sizing:border-box;
}
@keyframes historyPanelIn{
  from{opacity:.55;transform:translateY(2px)}
  to{opacity:1;transform:translateY(0)}
}
.history-panel-title{
  font-size:16px;
  font-weight:800;
  color:#20384d;
  margin-bottom:10px;
}
.history-year-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:10px 12px;
  background:#eef5fb;
  border:1px solid #d8e6f2;
  border-left:4px solid #0b5cab;
  border-radius:8px;
}
.history-year-row span{
  color:#53687a;
  font-size:12px;
  font-weight:600;
}
.history-year-row strong{
  color:#0b5cab;
  font-size:18px;
}
.history-distance{
  margin:7px 2px 11px;
  color:#6b7c8c;
  font-size:11px;
}
.history-details{
  border:1px solid #e1e7ed;
  border-radius:8px;
  overflow:hidden;
  background:#fff;
}
.history-detail-row{
  display:flex;
  justify-content:space-between;
  gap:12px;
  padding:7px 9px;
  border-bottom:1px solid #edf1f4;
}
.history-detail-row:last-child{
  border-bottom:0;
}
.history-detail-row span{
  color:#6a7886;
  flex:0 0 43%;
}
.history-detail-row strong{
  color:#263746;
  font-weight:600;
  text-align:right;
  overflow-wrap:anywhere;
}
.history-hisgis-result{
  margin-top:4px;
}
.history-loading-hint{
  padding:11px 12px;
  background:#f7f9fb;
  border:1px dashed #cbd7e2;
  border-radius:8px;
  color:#687888;
  font-size:12px;
}
.leaflet-popup-content-wrapper{
  border-radius:12px;
}
.leaflet-popup-content{
  margin:12px 14px;
}
@media (max-width:480px){
  .history-popup{
    min-width:260px;
    max-width:calc(100vw - 58px);
    min-width:280px;
  }
  .history-detail-row{
    display:block;
  }
  .history-detail-row strong{
    display:block;
    text-align:left;
    margin-top:2px;
  }
}

/* =========================================================
   Professionele info-pagina
   ========================================================= */
.info-intro{
  display:flex;
  flex-direction:column;
  gap:4px;
  margin-bottom:18px;
  padding:13px 14px;
  background:#eef5fb;
  border:1px solid #d8e6f2;
  border-left:4px solid #0b5cab;
  border-radius:10px;
}
.info-intro strong{
  color:#20384d;
  font-size:16px;
}
.info-intro span{
  color:#5d7081;
  font-size:12.5px;
}
.info-section{
  margin:0 0 17px;
}
.info-section h3{
  margin:0 0 6px;
  color:#20384d;
  font-size:13.5px;
  font-weight:800;
}
.info-section p{
  margin:0 0 7px;
  color:#465867;
  font-size:12.5px;
  line-height:1.5;
}
.info-section p:last-child{
  margin-bottom:0;
}
.info-sources{
  padding-top:13px;
  border-top:1px solid #e1e7ed;
}
