:root {
  --bg: #f4f5f7;
  --panel-w: 320px;
  --c-vacancy: #e74d31;
  --c-negative: #7ab800;
  --c-error: #b0b0b0;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; width: 100%; margin: 0; padding: 0; }
.map-container { height: 100%; width: 100%; }
/* Land base colour: shows through where the self-hosted vector tiles draw nothing. */
#map { background: #f2efe9; }

#panel {
  position: fixed; top: 0; left: 0; z-index: 10;
  width: var(--panel-w); height: 100%;
  background: #fff; box-shadow: 2px 0 12px rgba(0,0,0,.12);
  display: flex; flex-direction: column; overflow-y: auto;
  font-family: system-ui, -apple-system, sans-serif; font-size: 14px; color: #333;
}

#panel header { padding: 16px; border-bottom: 1px solid #e8e8e8; position: relative; }
#panel h1 { font-size: 20px; margin-bottom: 8px; padding-right: 72px; }

.map-container { flex: 1; }

.intro-open {
  position: absolute; top: 16px; right: 16px;
  width: 24px; height: 24px; border-radius: 50%;
  border: 1px solid #ccc; background: #fff; color: #666;
  font: italic 600 13px/1 Georgia, serif; cursor: pointer;
}
.intro-open:hover { border-color: var(--c-vacancy); color: var(--c-vacancy); }

/* ---------- language switcher ---------- */
.lang {
  display: flex; gap: 4px; margin-top: 10px;
}
.lang button {
  border: 1px solid #ddd; background: #fff; border-radius: 4px;
  padding: 2px 6px; font-size: 11px; font-weight: 600; cursor: pointer; color: #666;
}
.lang button.active {
  border-color: var(--c-vacancy); color: var(--c-vacancy); background: #fffaf9;
}

.stats { font-size: 12px; color: #666; line-height: 1.6; }
.pulse-line { font-size: 12px; color: #666; margin: 0; line-height: 1.6; }
.pulse-line a { color: var(--c-vacancy); text-decoration: none; }
.pulse-line a:hover { text-decoration: underline; }

#search-form { padding: 4px 16px 12px; }
#search-form input {
  width: 100%; border: 1px solid #ddd; border-radius: 6px;
  padding: 8px 10px; font-size: 13px; font-family: inherit; color: #333;
}
#search-form input:focus { outline: none; border-color: var(--c-vacancy); }

#share-row { padding: 0 16px 12px; display: flex; gap: 8px; }
#share, #near {
  flex: 1; border: 1px solid #ddd; border-radius: 6px; background: #fff;
  padding: 7px 10px; font-size: 12px; font-family: inherit; font-weight: 600;
  color: #666; cursor: pointer;
}
#share:hover, #near:hover { border-color: var(--c-vacancy); color: var(--c-vacancy); }
#near:disabled { opacity: .6; cursor: default; }
.near-count {
  padding: 0 16px 10px; font-size: 12px; font-weight: 600;
  color: var(--c-vacancy);
}
.zoeker-clear {
  display: block; margin: 0 16px 12px; padding: 0; border: 0; background: none;
  font-family: inherit; font-size: 12px; font-weight: 600; color: #6b7280;
  text-decoration: underline; cursor: pointer;
}
.zoeker-clear:hover { color: var(--c-vacancy); }

.detail { display: none; }

/* ---------- company popup ---------- */
.popup {
  position: absolute; z-index: 20;
  background: #fff; color: #2b2d33;
  border-radius: 10px; box-shadow: 0 8px 28px rgba(0,0,0,.25);
  padding: 14px 16px; min-width: 220px; max-width: 300px;
  font-family: system-ui, -apple-system, sans-serif; font-size: 13px; line-height: 1.5;
}
.popup[hidden] { display: none; }
.popup::after {
  content: ""; position: absolute; left: 50%; bottom: -8px; transform: translateX(-50%);
  width: 0; height: 0; border-left: 8px solid transparent;
  border-right: 8px solid transparent; border-top: 8px solid #fff;
}
.popup-close {
  position: absolute; top: 6px; right: 8px; border: 0; background: none;
  font-size: 18px; line-height: 1; color: #999; cursor: pointer;
}
.popup-close:hover { color: #333; }
.popup-name { font-size: 15px; font-weight: 700; margin: 0 18px 2px 0; }
.popup-badge {
  display: inline-block; font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: #fff; background: var(--c-vacancy);
  border-radius: 4px; padding: 1px 6px; margin-bottom: 8px;
}
.popup-badge.negative { background: var(--c-negative); }
.popup-badge.error { background: var(--c-error); }
.popup-badge.unchecked { background: #6b7280; }
.popup-row { display: flex; gap: 8px; margin-top: 4px; }
.popup-row .k { color: #8a8d95; flex: 0 0 68px; }
.popup-row .v { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.popup a { color: var(--c-vacancy); text-decoration: none; }
.popup a:hover { text-decoration: underline; }

.legend { list-style: none; padding: 0 16px 12px; font-size: 12px; color: #555; }
.legend li { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; cursor: pointer; user-select: none; }
.legend li:hover { color: #333; }
.legend li.off { opacity: .4; }
.legend li.off .swatch { filter: grayscale(1); }
.legend li.off span:last-child { text-decoration: line-through; }

.stale-toggle {
  display: flex; align-items: center; gap: 8px;
  padding: 0 16px 12px; font-size: 12px; color: #555;
  cursor: pointer; user-select: none;
}
.stale-toggle:hover { color: #333; }

#about { padding: 0 16px 16px; }
#about summary {
  display: flex; align-items: center; gap: 6px; cursor: pointer;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .12em;
  color: var(--c-vacancy); padding: 8px 0 6px; list-style: none;
}
#about summary::-webkit-details-marker { display: none; }
#about summary::before { content: "›"; font-size: 14px; line-height: 1; transition: transform .15s ease; }
#about[open] summary::before { transform: rotate(90deg); }
#about p { font-size: 12.5px; line-height: 1.55; color: #3a3d45; margin: 8px 0; }
#about a { color: var(--c-vacancy); text-decoration: none; }
#about a:hover { text-decoration: underline; }
.swatch { width: 18px; height: 22px; display: inline-flex; flex-shrink: 0; }
.swatch svg { width: 100%; height: 100%; display: block; }

/* ---------- intro dialog ---------- */
.intro {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background: rgba(20, 22, 28, .55);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  font-family: system-ui, -apple-system, sans-serif;
}
.intro[hidden] { display: none; }

.intro-card {
  width: 100%; max-width: 560px; max-height: 90vh; overflow-y: auto;
  background: #fff; color: #2b2d33; border-radius: 16px;
  padding: 32px 36px; box-shadow: 0 24px 60px rgba(0,0,0,.35);
  animation: intro-in .28s ease-out;
}
@keyframes intro-in { from { opacity: 0; transform: translateY(12px) scale(.98); } }

.intro-kicker {
  text-transform: uppercase; letter-spacing: .12em;
  font-size: 11px; font-weight: 700; color: var(--c-vacancy); margin-bottom: 6px;
}
.intro-title { font-size: 28px; line-height: 1.1; margin-bottom: 16px; }
.intro-card p { font-size: 15px; line-height: 1.6; color: #3a3d45; margin-bottom: 14px; }
.intro-lead { font-size: 16px; color: #1f2126; }
.intro-points { list-style: none; margin: 18px 0; display: grid; gap: 10px; }
.intro-points li {
  font-size: 14px; line-height: 1.5; color: #3a3d45;
  border-left: 3px solid var(--c-vacancy); padding-left: 12px;
}
.intro-points strong { color: #1f2126; }
.intro-close-line { font-weight: 600; color: #1f2126; }
.intro-start {
  display: block; width: 100%; margin-top: 8px;
  background: var(--c-vacancy); color: #fff; border: 0; border-radius: 8px;
  padding: 13px 20px; font-size: 15px; font-weight: 600; cursor: pointer;
}
.intro-start:hover { filter: brightness(1.06); }
.intro-foot { font-size: 12px !important; color: #8a8d95 !important; text-align: center; margin: 14px 0 0 !important; }
.intro-companies {
  display: block; width: 100%; margin-top: 8px; padding: 11px 20px;
  color: var(--c-vacancy); text-decoration: none; font-weight: 600; font-size: 14px;
  text-align: center; border: 1px solid var(--c-vacancy); border-radius: 8px;
  box-sizing: border-box;
}
.intro-companies:hover { background: #fffaf9; }

@media (max-width:768px) {
  #panel { width: var(--panel-w); max-height: 50%; height: unset; bottom: 0; top: auto; border-radius: 12px 12px 0 0; overflow-y: auto; }
}
