/* EVENTMAP_REAL_PROBLEMS_V1 – small source-first analysis panel, not a modal. */
#em-problems-live-panel[hidden] {display:none!important;}
#em-problems-live-panel {
  position:fixed;bottom:26px;left:18px;z-index:1150;
  width:min(345px,calc(100vw - 30px));max-height:min(57vh,520px);
  display:flex;flex-direction:column;gap:10px;
  background:linear-gradient(155deg,#102c41f7,#071c2ef5);
  color:#e8f5ff;border:1px solid #36647c;
  border-radius:17px;padding:16px;
  box-shadow:0 16px 55px #000a;backdrop-filter:blur(16px);
  font:12px/1.45 Inter,system-ui,sans-serif;
}
#em-problems-live-panel * {box-sizing:border-box;}
#em-problems-live-panel .em-problems-head {display:flex;justify-content:space-between;align-items:center;gap:9px;}
#em-problems-live-panel .em-problems-head-titles {display:grid;gap:2px;}
#em-problems-live-panel .em-problems-overline {font-size:9px;font-weight:800;letter-spacing:1.6px;color:#69b9d9;}
#em-problems-live-panel .em-problems-title {font-size:17px;font-weight:800;letter-spacing:-.4px;}
#em-problems-live-panel .em-problems-number {font-size:17px;font-weight:800;color:#65d9ff;
  border-radius:11px;background:#123e58;padding:6px 11px;}
#em-problems-live-panel .em-problems-status {font-size:11px;color:#a5c4d5;}
#em-problems-live-panel .em-problems-actions {display:flex;gap:8px;}
#em-problems-live-panel .em-problems-category {background:#15354a;color:#dceeff;min-width:0;flex:1;
  border:1px solid #346179;border-radius:9px;padding:8px;outline:none;cursor:pointer;}
#em-problems-live-panel .em-problems-refresh,
#em-problems-live-panel .em-problems-close {background:#1b4056;color:#d6f0fb;border:1px solid #3e6983;
  border-radius:9px;min-width:34px;font-size:19px;cursor:pointer;}
#em-problems-live-panel .em-problems-detail {border-top:1px solid #35566b;
  padding-top:11px;overflow-y:auto;max-height:34vh;}
#em-problems-live-panel .em-problems-detail-head {display:flex;justify-content:space-between;align-items:center;
  gap:10px;color:#72c6e8;}
#em-problems-live-panel .em-problems-detail h3 {font-size:14px;line-height:1.4;margin:7px 0;}
#em-problems-live-panel .em-problems-detail p {font-size:12px;color:#d3e2ed;line-height:1.55;margin:8px 0;}
#em-problems-live-panel .em-problems-meta {font-size:11px;color:#91bad1;}
#em-problems-live-panel .em-problems-precision {font-size:10px;color:#f0c28a;margin:8px 0;}
#em-problems-live-panel .em-problems-source {color:#68ccff;display:block;font-size:11px;font-weight:700;margin-top:10px;}
#em-problems-live-panel .em-problems-foot {font-size:10px;color:#89a8b8;border-top:1px solid #244658;padding-top:9px;}
#em-problems-live-panel .em-problems-cluster-list {max-height:27vh;overflow:auto;}
#em-problems-live-panel .em-problems-cluster-row {display:block;text-align:left;width:100%;border:0;
  border-bottom:1px solid #305369;background:transparent;color:#d7eaf5;cursor:pointer;padding:9px 4px;}
#em-problems-live-panel .em-problems-cluster-row:hover{background:#214860;}
@media(max-width:730px){
  #em-problems-live-panel{bottom:12px;left:12px;width:min(315px,calc(100vw - 24px));
    max-height:46vh;padding:12px;}
  #em-problems-live-panel .em-problems-title{font-size:15px;}
}


/* EVENTMAP_PROBLEMS_HORIZONTAL_SLIDER_V2
   Hide the original time-travel timeline ONLY in Problems mode.
   Keep it untouched for Climate, Traffic, Business Intel and other modes. */
body[data-em-clean-mode='main'] #timeline,
body[data-em-clean-mode='main'] #event-timeline,
body[data-em-clean-mode='main'] [data-em-original-timeline='true'] {
  display: none !important;
}
#em-problems-slider[hidden] { display:none !important; }
#em-problems-slider {
  display:none;
  position:fixed;
  left:22px;
  right:342px;
  bottom:18px;
  height:clamp(245px,30vh,298px);
  z-index:1800;
  flex-direction:column;
  box-sizing:border-box;
  overflow:hidden;
  background:linear-gradient(155deg,rgba(5,23,41,.97),rgba(8,37,56,.96));
  color:#e8f5ff;
  border:1px solid #367b9b9e;
  border-radius:18px;
  box-shadow:0 20px 64px #0009;
  backdrop-filter:blur(15px);
  font:12px/1.45 Inter,system-ui,sans-serif;
}
body[data-em-clean-mode='main'] #em-problems-slider:not([hidden]) { display:flex; }
#em-problems-slider * { box-sizing:border-box; }
#em-problems-slider .em-ps-header {
  flex:0 0 auto;
  display:flex;align-items:center;justify-content:space-between;gap:12px;
  padding:12px 15px 8px;
  border-bottom:1px solid #3265866b;
}
#em-problems-slider .em-ps-identity {min-width:0;display:flex;flex-direction:column;gap:3px;}
#em-problems-slider .em-ps-kicker {font-size:9px;letter-spacing:1.15px;font-weight:850;color:#78c6e8;}
#em-problems-slider .em-ps-title {font-size:20px;letter-spacing:-.5px;line-height:1.2;font-weight:820;margin:0;}
#em-problems-slider .em-ps-stats {display:flex;gap:10px;align-items:center;min-width:0;}
#em-problems-slider .em-ps-count {font-size:11px;color:#81dcff;white-space:nowrap;}
#em-problems-slider .em-ps-status {font-size:10px;color:#9cb6c6;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
#em-problems-slider .em-ps-controls {display:flex;align-items:center;gap:6px;flex:0 0 auto;}
#em-problems-slider .em-ps-category,
#em-problems-slider .em-ps-button {
  border:1px solid #355f7a;
  background:#123149;
  color:#d8ecfc;
  border-radius:9px;
  height:34px;
}
#em-problems-slider .em-ps-category {max-width:205px;min-width:96px;padding:0 9px;cursor:pointer;}
#em-problems-slider .em-ps-button {min-width:34px;padding:0 10px;font-size:22px;font-weight:750;cursor:pointer;}
#em-problems-slider .em-ps-button:hover:not(:disabled) {background:#1d5376;border-color:#56b9f4;}
#em-problems-slider .em-ps-button:disabled {opacity:.38;cursor:default;}
#em-problems-slider .em-ps-track {
  min-height:0;flex:1 1 auto;display:flex;flex-flow:row nowrap;gap:11px;
  overflow-x:auto;overflow-y:hidden;scroll-snap-type:x mandatory;
  padding:11px 14px 13px;
  scrollbar-width:thin;scrollbar-color:#317da5 transparent;
}
#em-problems-slider .em-ps-card {
  min-width:0;flex:0 0 clamp(262px,35%,395px);
  padding:11px 12px;display:flex;flex-direction:column;gap:6px;
  border:1px solid #326b91a3;border-radius:12px;
  background:linear-gradient(155deg,#123650e0,#09293ee8);
  scroll-snap-align:start;cursor:pointer;overflow:hidden;
}
#em-problems-slider .em-ps-card:hover {background:#16415fe8;border-color:#55aef0;}
#em-problems-slider .em-ps-card[aria-current='true'] {
  border-color:#6ce1fc;box-shadow:inset 0 0 0 1px #60c1ef8c;background:#1a4969f0;
}
#em-problems-slider .em-ps-card-header,
#em-problems-slider .em-ps-card-footer {display:flex;justify-content:space-between;align-items:center;gap:9px;min-width:0;}
#em-problems-slider .em-ps-card-category {display:flex;align-items:center;min-width:0;gap:6px;color:#9ce3fc;font-size:10px;font-weight:750;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
#em-problems-slider .em-ps-dot {flex:none;width:7px;height:7px;border-radius:50%;box-shadow:0 0 0 3px #ffffff18;}
#em-problems-slider .em-ps-card-state {flex:none;font-size:9px;color:#b6c9d6;background:#28506c8a;border:1px solid #47718b8a;border-radius:6px;padding:2px 6px;white-space:nowrap;text-transform:capitalize;}
#em-problems-slider .em-ps-card-title {margin:0;font-size:13px;line-height:1.35;font-weight:750;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;}
#em-problems-slider .em-ps-card-meta {color:#9fc6da;font-size:10px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
#em-problems-slider .em-ps-card-summary {font-size:11px;line-height:1.38;color:#b7cad9;margin:0;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;}
#em-problems-slider .em-ps-card-footer {margin-top:auto;gap:10px;font-size:10px;border-top:1px solid #37607a73;padding-top:7px;}
#em-problems-slider .em-ps-source-name {min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#83a8c0;}
#em-problems-slider .em-ps-source-link {flex:none;text-decoration:none;color:#86ddff;font-weight:750;white-space:nowrap;}
#em-problems-slider .em-ps-source-link:hover {text-decoration:underline;}
#em-problems-slider .em-ps-empty {display:grid;place-items:center;width:100%;text-align:center;color:#9bbfce;padding:24px;}

/* The old side panel is now a contextual source/details popover only. */
body[data-em-clean-mode='main'] #em-problems-live-panel:not(.em-problems-detail-open) {display:none!important;}
body[data-em-clean-mode='main'] #em-problems-live-panel.em-problems-detail-open {
  display:flex!important;
  position:fixed!important;left:22px!important;right:auto!important;
  bottom:calc(clamp(245px,30vh,298px) + 31px)!important;
  width:min(445px,calc(100vw - 355px))!important;
  max-height:calc(100vh - clamp(245px,30vh,298px) - 125px)!important;
  z-index:1810!important;
  padding:13px!important;
}
body[data-em-clean-mode='main'] #em-problems-live-panel.em-problems-detail-open
  :is(.em-problems-head,.em-problems-status,.em-problems-actions,.em-problems-foot) {display:none!important;}
body[data-em-clean-mode='main'] #em-problems-live-panel.em-problems-detail-open .em-problems-detail {
  border-top:0!important;padding-top:0!important;max-height:60vh!important;
}
@media(max-width:1050px){
  #em-problems-slider {right:285px;}
  #em-problems-slider .em-ps-status {max-width:130px;}
  #em-problems-slider .em-ps-category {max-width:150px;}
  body[data-em-clean-mode='main'] #em-problems-live-panel.em-problems-detail-open {width:min(420px,calc(100vw - 312px))!important;}
}
@media(max-width:899px){
  #em-problems-slider {right:12px;left:12px;bottom:12px;height:clamp(188px,30vh,260px);border-radius:15px;}
  #em-problems-slider .em-ps-header {padding:8px 10px;gap:8px;flex-wrap:wrap;}
  #em-problems-slider .em-ps-kicker {font-size:8px;letter-spacing:.6px;}
  #em-problems-slider .em-ps-title {font-size:16px;}
  #em-problems-slider .em-ps-stats {gap:8px;}
  #em-problems-slider .em-ps-status {max-width:180px;}
  #em-problems-slider .em-ps-controls {flex:1;justify-content:flex-end;}
  #em-problems-slider .em-ps-category {flex:1;max-width:170px;}
  #em-problems-slider .em-ps-track {padding:8px 9px 10px;}
  #em-problems-slider .em-ps-card {flex-basis:min(290px,84vw);}
  body[data-em-clean-mode='main'] #em-problems-live-panel.em-problems-detail-open {
    left:12px!important;bottom:calc(clamp(188px,30vh,260px) + 22px)!important;
    width:min(420px,calc(100vw - 24px))!important;
    max-height:calc(100vh - clamp(188px,30vh,260px) - 85px)!important;
  }
}
@media(max-width:520px){
  #em-problems-slider .em-ps-header {flex-wrap:nowrap;align-items:flex-start;}
  #em-problems-slider .em-ps-controls {flex:0 0 auto;}
  #em-problems-slider .em-ps-category {width:100px;max-width:100px;}
  #em-problems-slider .em-ps-refresh {display:none;}
  #em-problems-slider .em-ps-button {min-width:29px;height:30px;font-size:18px;padding:0 7px;}
  #em-problems-slider .em-ps-status {max-width:145px;}
  #em-problems-slider .em-ps-card-summary {display:none;}
}
@media(prefers-reduced-motion: reduce){
  #em-problems-slider .em-ps-track {scroll-behavior:auto;}
}

/* EVENTMAP_PROBLEMS_PRECISION_VISUAL_V3 — clear, clickable incident pins. */
#em-problems-slider .em-ps-card { transition: border-color .18s ease, background .18s ease, transform .18s ease; }
#em-problems-slider .em-ps-card:hover { transform:translateY(-2px); }
#em-problems-slider .em-ps-card:focus-visible {
  outline:2px solid #8addff;outline-offset:2px;
}
#em-problems-slider .em-ps-card[aria-current='true'] {
  border-color:#8ddaff;box-shadow:0 0 0 1px #8bdafa55,0 8px 24px #020e186a;
}
#em-problems-live-panel.em-problems-detail-open .em-problems-detail {
  color:#e7f5fc;
  background:linear-gradient(150deg,#122d42,#081f30);
}
#em-problems-live-panel .em-pd-place {
  padding:9px 10px;margin-top:10px;
  background:#123a50;border:1px solid #33709088;
  border-radius:9px;font-weight:650;color:#cee8f6;
  overflow-wrap:anywhere;
}
#em-problems-live-panel .em-pd-accuracy {
  margin-top:7px;letter-spacing:.01em;
  color:#a7c3d1;font-size:11px;line-height:1.4;
}
#em-problems-live-panel .em-problems-cluster-row {
  text-align:left;display:block;padding:11px 10px;
  border:1px solid #2c5671;border-radius:10px;
  background:#0e3047;color:#f0f9fe;cursor:pointer;
}
#em-problems-live-panel .em-problems-cluster-row:hover,
#em-problems-live-panel .em-problems-cluster-row:focus-visible {
  border-color:#65c3f5;background:#17455f;
}
#em-problems-live-panel .em-problems-cluster-list {
  display:flex;flex-direction:column;gap:7px;max-height:min(45vh,330px);
  overflow-y:auto;margin-top:10px;
}
#em-problems-live-panel .em-problems-cluster-row .em-cluster-category {
  display:block;font-size:10px;color:#9cd6ef;margin-bottom:3px;
}
#em-problems-live-panel .em-problems-detail > h3 {
  font-size:16px;line-height:1.35;overflow-wrap:anywhere;
}


/* EVENTMAP_PROBLEMS_MAP_INTERACTION_VISUAL_V4
   Sleeker map pins and compact count clusters; does not alter EventMap's map
   shell or the independent Problems overlay's pointer/camera restrictions. */
#em-problems-live-panel[hidden], #em-problems-slider[hidden] {display:none!important;}
body[data-em-clean-mode='main'] #em-problems-live-panel.em-problems-detail-open {
  position:fixed!important;
  top:78px!important;
  bottom:auto!important;
  left:96px!important;
  right:auto!important;
  width:min(395px,calc(100vw - 430px))!important;
  max-height:min(49vh,440px)!important;
  padding:15px!important;
  border:1px solid #4b839e!important;
  border-radius:16px!important;
  background:linear-gradient(150deg,rgba(7,27,44,.98),rgba(12,46,66,.98))!important;
  box-shadow:0 20px 60px #020c19c9!important;
  z-index:1900!important;
  overflow-y:auto!important;
}
body[data-em-clean-mode='main'] #em-problems-live-panel.em-problems-detail-open .em-problems-detail {
  max-height:100%!important;overflow-y:auto!important;
}
.em-problems-map-tooltip[hidden] {display:none!important;}
.em-problems-map-tooltip {
  position:fixed;z-index:1795;pointer-events:none;
  width:max-content;max-width:min(290px,65vw);
  display:flex;flex-direction:column;gap:5px;
  padding:10px 12px;border-radius:10px;
  background:#081d2efa;color:#f1faff;border:1px solid #4e8bae;
  box-shadow:0 10px 32px #000a;
  font:12px/1.4 Inter,system-ui,sans-serif;
}
.em-problems-map-tooltip .em-pmt-category {
  color:#79c8e8;font-size:9px;font-weight:800;letter-spacing:1px;
  text-transform:uppercase;
}
.em-problems-map-tooltip .em-pmt-heading {
  font-size:12px;font-weight:700;line-height:1.35;
}
body.em-problems-pin-hover #map .maplibregl-canvas-container > canvas {
  cursor:pointer!important;
}
@media(max-width:899px){
  body[data-em-clean-mode='main'] #em-problems-live-panel.em-problems-detail-open {
    top:70px!important;bottom:auto!important;left:82px!important;
    right:auto!important;width:min(355px,calc(100vw - 96px))!important;
    max-height:37vh!important;
    padding:12px!important;
  }
}
@media(max-width:520px){
  body[data-em-clean-mode='main'] #em-problems-live-panel.em-problems-detail-open {
    left:12px!important;top:74px!important;width:calc(100vw - 24px)!important;
    max-height:38vh!important;
  }
}


/* EVENTMAP_PROBLEMS_MOBILE_MENU_V5 — Events-style openable mobile Problems menu.
   Desktop keeps the existing bottom horizontal slider and map layout. */
#em-problems-mobile-toggle,
#em-ps-mobile-close { display:none; }
#em-problems-mobile-toggle[hidden],
#em-ps-mobile-close[hidden] { display:none!important; }
@media (max-width:899px) {
  body[data-em-clean-mode='main'] #em-problems-mobile-toggle:not([hidden]) {
    position:fixed!important;
    top:68px!important;
    right:12px!important;
    bottom:auto!important;
    width:auto!important;
    min-width:118px!important;
    height:43px!important;
    z-index:1950!important;
    border:1px solid #4287ab!important;
    border-radius:12px!important;
    background:linear-gradient(135deg,#0f3148,#0a2034)!important;
    color:#effaff!important;
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    gap:7px!important;
    padding:0 10px!important;
    font:700 12px/1.1 Inter,system-ui,sans-serif!important;
    box-shadow:0 7px 22px #020e1bbf!important;
    cursor:pointer!important;
    pointer-events:auto!important;
  }
  #em-problems-mobile-toggle .em-pm-toggle-icon {
    font-size:20px;line-height:1;color:#7ad8ff;
  }
  #em-problems-mobile-toggle .em-pm-toggle-count {
    display:grid;place-items:center;
    min-width:20px;height:19px;padding:0 4px;
    font:800 10px/1 Inter,system-ui,sans-serif;
    color:white;background:#167bb4;border-radius:7px;
  }
  body[data-em-clean-mode='main'] #em-problems-slider:not([hidden]) {
    position:fixed!important;
    inset:64px 9px 9px 9px!important;
    top:64px!important;right:9px!important;bottom:9px!important;left:9px!important;
    width:auto!important;
    height:auto!important;
    min-height:0!important;
    max-height:none!important;
    display:flex!important;
    flex-direction:column!important;
    z-index:1920!important;
    overflow:hidden!important;
    background:linear-gradient(150deg,#0d2033fa,#0b293efc)!important;
    border:1px solid #386e8c!important;
    border-radius:17px!important;
    box-shadow:0 16px 50px #000d!important;
    backdrop-filter:blur(16px);
  }
  body[data-em-clean-mode='main'] #em-problems-slider .em-ps-header {
    flex:0 0 auto!important;
    padding:14px 13px 11px!important;
    display:flex!important;
    flex-wrap:wrap!important;
    flex-direction:row!important;
    align-items:center!important;
    gap:10px!important;
    border-bottom:1px solid #355c7380!important;
  }
  body[data-em-clean-mode='main'] #em-problems-slider .em-ps-identity {
    width:100%!important;
    flex:1 0 100%!important;
    gap:3px!important;
  }
  body[data-em-clean-mode='main'] #em-problems-slider .em-ps-title {
    font-size:20px!important;
  }
  body[data-em-clean-mode='main'] #em-problems-slider .em-ps-controls {
    width:100%!important;
    flex:1 0 100%!important;
    display:flex!important;
    align-items:center!important;
    justify-content:space-between!important;
    gap:9px!important;
  }
  body[data-em-clean-mode='main'] #em-problems-slider .em-ps-category {
    width:auto!important;
    min-width:0!important;
    max-width:none!important;
    flex:1 1 auto!important;
    font-size:12px!important;
    height:38px!important;
  }
  body[data-em-clean-mode='main'] #em-problems-slider .em-ps-refresh {
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    height:38px!important;
    min-width:38px!important;
  }
  body[data-em-clean-mode='main'] #em-problems-slider #em-ps-prev,
  body[data-em-clean-mode='main'] #em-problems-slider #em-ps-next {
    display:none!important;
  }
  body[data-em-clean-mode='main'] #em-problems-slider #em-ps-mobile-close:not([hidden]) {
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    min-width:40px!important;
    width:40px!important;
    height:38px!important;
    padding:0!important;
    font-size:25px!important;
    line-height:1!important;
    border-radius:10px!important;
    background:#203c52!important;
    color:#f0faff!important;
  }
  body[data-em-clean-mode='main'] #em-problems-slider .em-ps-track {
    flex:1 1 auto!important;
    min-height:0!important;
    display:flex!important;
    flex-flow:column nowrap!important;
    overflow-x:hidden!important;
    overflow-y:auto!important;
    scroll-snap-type:none!important;
    overscroll-behavior:contain!important;
    padding:12px!important;
    gap:10px!important;
  }
  body[data-em-clean-mode='main'] #em-problems-slider .em-ps-card {
    box-sizing:border-box!important;
    flex:0 0 auto!important;
    width:100%!important;
    min-width:0!important;
    height:auto!important;
    min-height:132px!important;
    max-height:none!important;
    padding:13px!important;
    scroll-snap-align:none!important;
    overflow:hidden!important;
  }
  body[data-em-clean-mode='main'] #em-problems-slider .em-ps-card-summary {
    display:-webkit-box!important;
  }
  body[data-em-clean-mode='main'] #em-problems-live-panel.em-problems-detail-open {
    position:fixed!important;
    top:65px!important;
    bottom:auto!important;
    left:9px!important;
    right:9px!important;
    width:auto!important;
    max-width:none!important;
    max-height:calc(100dvh - 82px)!important;
    overflow-y:auto!important;
    z-index:1940!important;
  }
}

