/* SZMG kaart-widget — insluitbare sociale kaart (Leaflet). Gescoped onder
   .szmg-kaart; deelt het thema (--szmg-*) met de chat-widget. */

.szmg-kaart {
  --szmg-primary: #1B2D78; --szmg-primary-dk: #13215A;
  --szmg-accent: #00B4CC; --szmg-accent-dk: #0097AD; --szmg-accent-lt: #E0F7FA;
  --szmg-bg: #ffffff; --szmg-soft: #f5f4fb; --szmg-text: #1f2937; --szmg-text-sm: #64748b;
  --szmg-line: #e5e7eb; --szmg-radius: 16px;
  --szmg-font: 'Open Sans', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;

  font-family: var(--szmg-font); color: var(--szmg-text); background: var(--szmg-bg);
  border: 1px solid var(--szmg-line); border-radius: var(--szmg-radius);
  display: flex; flex-direction: column; overflow: hidden; box-sizing: border-box;
}
.szmg-kaart *, .szmg-kaart *::before, .szmg-kaart *::after { box-sizing: border-box; }

.szmg-k-head { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-bottom: 1px solid var(--szmg-line); flex-wrap: wrap; }
.szmg-k-title { font-weight: 700; font-size: 1.05rem; color: var(--szmg-primary); flex-shrink: 0; }
.szmg-k-search { flex: 1; min-width: 180px; display: flex; align-items: center; gap: 8px; border: 1.5px solid var(--szmg-line); border-radius: 50px; padding: 7px 14px; }
.szmg-k-search:focus-within { border-color: var(--szmg-accent); }
.szmg-k-search svg { width: 16px; height: 16px; stroke: var(--szmg-text-sm); stroke-width: 2; fill: none; flex-shrink: 0; }
.szmg-k-search input { flex: 1; border: none; outline: none; font-family: inherit; font-size: .88rem; color: var(--szmg-text); background: none; min-width: 0; }

.szmg-k-filters { display: flex; align-items: center; gap: 9px; padding: 11px 18px; border-bottom: 1px solid var(--szmg-line); flex-wrap: wrap; background: var(--szmg-soft); }
.szmg-k-filters select { border: 1.5px solid var(--szmg-line); border-radius: 9px; padding: 7px 11px; font-family: inherit; font-size: .82rem; color: var(--szmg-text); background: #fff; cursor: pointer; max-width: 200px; }
.szmg-k-reset { border: 1.5px solid var(--szmg-line); background: #fff; border-radius: 9px; padding: 7px 12px; font-family: inherit; font-size: .82rem; color: var(--szmg-text-sm); cursor: pointer; }
.szmg-k-reset:hover { border-color: var(--szmg-accent); color: var(--szmg-accent-dk); }
.szmg-k-favtoggle { display: inline-flex; align-items: center; gap: 6px; border: 1.5px solid var(--szmg-line); background: #fff; border-radius: 9px; padding: 7px 12px; font-family: inherit; font-size: .82rem; font-weight: 600; color: var(--szmg-text-sm); cursor: pointer; transition: .15s; }
.szmg-k-favtoggle:hover { border-color: #ef4444; color: #ef4444; }
.szmg-k-favtoggle.active { border-color: #ef4444; background: #ef44441a; color: #ef4444; }
.szmg-k-favtoggle.active svg { fill: currentColor; }
.szmg-k-count { font-size: .82rem; color: var(--szmg-text-sm); margin-left: auto; }
.szmg-k-count b, .szmg-k-count span { color: var(--szmg-primary); font-weight: 700; }

.szmg-k-body { flex: 1; display: flex; min-height: 0; position: relative; }
.szmg-k-map { flex: 1; min-width: 0; background: #e8eef3; }
.szmg-k-map .leaflet-container { height: 100%; width: 100%; font-family: var(--szmg-font); }

.szmg-k-side { width: 340px; flex-shrink: 0; border-left: 1px solid var(--szmg-line); position: relative; background: #fff; }
.szmg-k-list { position: absolute; inset: 0; overflow-y: auto; padding: 10px; }

.szmg-k-item { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 11px; cursor: pointer; transition: background .12s; }
.szmg-k-item:hover { background: var(--szmg-soft); }
.szmg-k-li-logo { width: 42px; height: 42px; border-radius: 8px; object-fit: cover; flex-shrink: 0; background: var(--szmg-soft); }
.szmg-k-li-name { font-weight: 700; font-size: .86rem; color: var(--szmg-primary); line-height: 1.3; }
.szmg-k-li-meta { font-size: .74rem; color: var(--szmg-text-sm); margin-top: 2px; display: flex; align-items: center; gap: 5px; }
.szmg-k-li-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.szmg-k-li-tx { flex: 1; min-width: 0; }
.szmg-k-li-fav { flex-shrink: 0; background: none; border: none; cursor: pointer; color: #CBD5E1; padding: 4px; display: flex; align-items: center; }
.szmg-k-li-fav:hover { color: #ef4444; }
.szmg-k-li-fav.on { color: #ef4444; }
.szmg-k-empty { text-align: center; color: var(--szmg-text-sm); padding: 34px 16px; font-size: .86rem; }

/* Detailpaneel — schuift over de lijst */
.szmg-k-detail { position: absolute; inset: 0; background: #fff; overflow-y: auto; transform: translateX(100%); transition: transform .25s ease; padding: 0; }
.szmg-k-detail.open { transform: translateX(0); }
.szmg-k-d-close { position: sticky; top: 0; float: right; margin: 10px 12px; width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--szmg-line); background: #fff; cursor: pointer; font-size: 1rem; color: var(--szmg-text-sm); z-index: 2; }
.szmg-k-d-inner { padding: 16px 18px 22px; }
.szmg-k-d-top { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 12px; }
.szmg-k-d-toptx { flex: 1; min-width: 0; }
.szmg-k-d-fav { flex-shrink: 0; background: none; border: 1.5px solid var(--szmg-line); border-radius: 50%; width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; cursor: pointer; color: #CBD5E1; }
.szmg-k-d-fav:hover { border-color: #ef4444; color: #ef4444; }
.szmg-k-d-fav.on { border-color: #ef4444; color: #ef4444; }
.szmg-k-d-logo { width: 54px; height: 54px; border-radius: 11px; object-fit: cover; flex-shrink: 0; }
.szmg-k-d-name { font-weight: 700; font-size: 1.05rem; color: var(--szmg-primary); line-height: 1.2; }
.szmg-k-d-soort { font-size: .78rem; color: var(--szmg-text-sm); margin-top: 3px; }
.szmg-k-d-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.szmg-k-d-pill { font-size: .72rem; font-weight: 600; padding: 3px 9px; border-radius: 50px; }
.szmg-k-d-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.szmg-k-d-act { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-width: 62px; border: 1.5px solid var(--szmg-line); border-radius: 10px; padding: 9px 14px; font-size: 0.7rem; font-weight: 600; color: var(--szmg-text); text-decoration: none; }
.szmg-k-d-act svg { width: 14px; height: 14px; }
.szmg-k-d-act.primary { background: var(--szmg-primary); color: #fff; border-color: var(--szmg-primary); }
.szmg-k-d-sec { margin-bottom: 16px; }
.szmg-k-d-sec-h { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--szmg-text-sm); margin-bottom: 7px; }
.szmg-k-d-desc { font-size: .86rem; color: var(--szmg-text); line-height: 1.6; }
.szmg-k-d-more { background: none; border: none; color: var(--szmg-accent-dk); font-weight: 600; font-size: .82rem; cursor: pointer; padding: 4px 0 0; font-family: inherit; }
.szmg-k-d-crow { display: flex; gap: 10px; align-items: flex-start; font-size: .84rem; padding: 6px 0; color: var(--szmg-text); }
.szmg-k-d-crow svg { width: 15px; height: 15px; stroke: var(--szmg-accent-dk); stroke-width: 2; fill: none; flex-shrink: 0; margin-top: 2px; }
.szmg-k-d-crow b { display: block; font-size: .72rem; color: var(--szmg-text-sm); font-weight: 600; }
.szmg-k-d-crow a { color: var(--szmg-accent-dk); text-decoration: none; }
.szmg-k-d-voorwie { display: flex; gap: 10px; align-items: center; background: var(--szmg-soft); border-radius: 10px; padding: 11px 13px; font-size: .84rem; line-height: 1.5; }
.szmg-k-d-vw-ic { width: 34px; height: 34px; border-radius: 50%; background: var(--szmg-accent-lt); color: var(--szmg-accent-dk); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.szmg-k-d-vw-ic svg { width: 16px; height: 16px; stroke: currentColor; stroke-width: 2; fill: none; }

/* Cluster- en pin-markers */
.szmg-kaart .sk-cluster { display: flex; align-items: center; justify-content: center; border-radius: 50%; color: #fff; font-weight: 800; border: 3px solid rgba(255,255,255,.85); box-shadow: 0 2px 8px rgba(0,0,0,.3); }

/* Legenda (Leaflet-control, rechtsboven) */
.szmg-k-legend { background: #fff; padding: 10px 13px; border-radius: 12px; box-shadow: 0 2px 12px rgba(16,24,40,.14); font-family: var(--szmg-font); min-width: 132px; }
.szmg-k-legend-h { font-weight: 800; color: var(--szmg-primary); margin-bottom: 7px; font-size: .76rem; }
.szmg-k-legend-row { display: flex; align-items: center; gap: 7px; margin-bottom: 5px; color: var(--szmg-text); font-size: .72rem; }
.szmg-k-legend-row:last-child { margin-bottom: 0; }
.szmg-k-legend-dot { width: 11px; height: 11px; border-radius: 50%; flex-shrink: 0; }

/* "Mijn locatie"-knop (Leaflet-control, linksboven) */
.szmg-k-locate { width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; background: #fff; border: none; border-radius: 9px; box-shadow: 0 2px 8px rgba(16,24,40,.18); cursor: pointer; color: var(--szmg-primary); }
.szmg-k-locate:hover { color: var(--szmg-accent-dk); }
.szmg-k-locate.busy { opacity: .55; pointer-events: none; }
.szmg-k-locate.busy svg { animation: szmg-k-spin .8s linear infinite; }
@keyframes szmg-k-spin { to { transform: rotate(360deg); } }

/* Ingebed chat-paneel (Mees / Sophie) — linksonder op de kaart */
.szmg-k-mees { position: absolute; left: 14px; bottom: 14px; z-index: 600; width: 320px; max-width: calc(100% - 28px); background: #fff; border-radius: 18px; box-shadow: 0 8px 30px rgba(27,45,120,.22); overflow: hidden; font-family: var(--szmg-font); }
.szmg-k-mees.collapsed { display: none; }
.szmg-k-mees-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px 8px; }
.szmg-k-mees-av { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; flex-shrink: 0; background: var(--szmg-soft); }
.szmg-k-mees-tx { flex: 1; min-width: 0; }
.szmg-k-mees-hi { font-weight: 700; color: var(--szmg-primary); font-size: .95rem; line-height: 1.2; }
.szmg-k-mees-q { font-size: .8rem; color: var(--szmg-text-sm); }
.szmg-k-mees-msg { margin: 0 14px 8px; padding: 10px 12px; border-radius: 12px; background: #F1F4FB; color: var(--szmg-text); font-size: .82rem; line-height: 1.45; }
.szmg-k-mees-msg.ai { background: #fdf6e8; color: #7a5212; border: 1px solid #f0dcae; }
.szmg-k-mees-msg.thinking { color: var(--szmg-text-sm); display: flex; align-items: center; gap: 8px; }
.szmg-k-mees-msg.empty { background: #fff4f4; color: #b91c1c; }
.szmg-k-mees-dots { display: inline-flex; gap: 3px; flex-shrink: 0; }
.szmg-k-mees-dots span { width: 6px; height: 6px; border-radius: 50%; background: var(--szmg-accent); animation: szmg-dot 1.1s ease-in-out infinite; }
.szmg-k-mees-dots span:nth-child(2) { animation-delay: .15s; }
.szmg-k-mees-dots span:nth-child(3) { animation-delay: .3s; }
@keyframes szmg-dot { 0%, 60%, 100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-4px); opacity: 1; } }
.szmg-k-mees-x { background: none; border: none; cursor: pointer; color: var(--szmg-text-sm); font-size: 1.3rem; line-height: 1; padding: 0 4px; flex-shrink: 0; }
.szmg-k-mees-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px 14px 10px; }
.szmg-k-mees-chips button { background: #F1F4FB; border: 1px solid #E1E7F4; border-radius: 16px; padding: 6px 11px; font-size: .74rem; font-weight: 600; color: var(--szmg-primary); cursor: pointer; font-family: inherit; }
.szmg-k-mees-chips button:hover { border-color: var(--szmg-accent); }
.szmg-k-chip-c { display: inline-block; background: rgba(27,45,120,.1); color: var(--szmg-primary); border-radius: 9px; padding: 0 5px; font-size: .66rem; margin-left: 3px; }
.szmg-k-mees-clear { background: #fff !important; border-color: var(--szmg-line) !important; color: var(--szmg-text-sm) !important; }
.szmg-k-mees-none { font-size: .78rem; color: var(--szmg-text-sm); padding: 2px 2px 6px; }
.szmg-k-mees-form { display: flex; align-items: center; gap: 8px; padding: 8px 12px 12px; }
.szmg-k-mees-form input { flex: 1; min-width: 0; border: 1.5px solid var(--szmg-line); border-radius: 50px; padding: 9px 14px; font-family: inherit; font-size: .84rem; outline: none; }
.szmg-k-mees-form input:focus { border-color: var(--szmg-accent); }
.szmg-k-mees-form button { flex-shrink: 0; width: 38px; height: 38px; border-radius: 50%; border: none; background: var(--szmg-primary); color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.szmg-k-mees-fab { position: absolute; left: 14px; bottom: 14px; z-index: 600; width: 56px; height: 56px; border-radius: 50%; background: #fff; border: 2px solid #fff; box-shadow: 0 6px 20px rgba(27,45,120,.28); cursor: pointer; padding: 0; color: var(--szmg-primary); font-weight: 800; font-size: 1.3rem; }
.szmg-k-mees-fab img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 50%; }
.szmg-k-mees-fab.intro { animation: szmg-fab-bounce .6s ease both; }
.szmg-k-mees-fab.intro::after { content: ''; position: absolute; inset: -3px; border-radius: 50%; border: 2px solid var(--szmg-accent); animation: szmg-fab-pulse 1.7s ease-out infinite; pointer-events: none; }
@keyframes szmg-fab-bounce { 0% { transform: scale(.5); opacity: .3; } 60% { transform: scale(1.12); } 100% { transform: scale(1); opacity: 1; } }
@keyframes szmg-fab-pulse { 0% { transform: scale(1); opacity: .65; } 100% { transform: scale(1.55); opacity: 0; } }

/* Intro-hint naast de FAB (linksonder), verschijnt kort bij het laden */
.szmg-k-mees-hint { position: absolute; left: 80px; bottom: 22px; z-index: 600; max-width: 210px; text-align: left; background: var(--szmg-primary); color: #fff; border: none; font-family: inherit; font-size: .82rem; font-weight: 600; line-height: 1.35; padding: 10px 13px; border-radius: 14px 14px 14px 4px; box-shadow: 0 6px 20px rgba(27,45,120,.3); cursor: pointer; opacity: 0; transform: translateX(-8px) scale(.96); transform-origin: left bottom; pointer-events: none; transition: opacity .35s ease, transform .35s ease; }
.szmg-k-mees-hint.show { opacity: 1; transform: translateX(0) scale(1); pointer-events: auto; }
.szmg-k-mees-hint::after { content: ''; position: absolute; left: -5px; bottom: 12px; width: 11px; height: 11px; background: var(--szmg-primary); transform: rotate(45deg); border-radius: 2px; }

@media (max-width: 720px) {
  .szmg-k-body { flex-direction: column; }
  .szmg-k-map { height: 280px; flex: none; }
  .szmg-k-side { width: 100%; border-left: none; border-top: 1px solid var(--szmg-line); flex: 1; }
}

/* Phosphor-iconen */
.szmg-k-d-crow .ph { font-size: 15px; flex-shrink: 0; }
.szmg-k-mees-form button .ph { font-size: 18px; }
