/* ERP02 Map as Core Feature — additive styles scoped to .kj-map-core */
.kj-map-core{position:relative;padding:18px 0 24px!important;max-width:none!important}
.kj-map-core .map-hero-head{width:min(1440px,96%);margin:0 auto 12px;gap:16px}
.kj-map-core .map-hero-head h1{font-size:clamp(26px,3vw,38px);margin:0 0 4px}
.kj-map-core .map-hero-head .muted{font-size:13px;line-height:1.5;max-width:680px}
.kj-map-core .map-legend{display:none}
.kj-map-core .map-layout{display:block;position:relative;width:100%;height:clamp(420px,calc(100vh - 330px),680px);min-height:420px;gap:0}
.kj-map-core .map-shell{position:absolute;inset:0;min-width:0;min-height:0;border-radius:20px;overflow:hidden;background:#e6eef0;box-shadow:0 14px 36px rgba(12,39,55,.13)}
.kj-map-core .real-map{width:100%;height:100%;min-height:0;touch-action:pan-y}
.kj-map-core .kj-map-float-panel{position:absolute;z-index:700;left:14px;top:14px;bottom:14px;width:min(340px,calc(100% - 28px));height:auto;padding:16px;display:flex;flex-direction:column;gap:10px;background:rgba(255,255,255,.97);border:1px solid rgba(218,230,235,.95);border-radius:18px;box-shadow:0 12px 32px rgba(11,37,52,.16);backdrop-filter:blur(12px);overflow:hidden}
.kj-map-core .kj-map-panel-heading{display:flex;align-items:center;justify-content:space-between;gap:10px}
.kj-map-core .kj-map-panel-heading .eyebrow{font-size:9px;letter-spacing:.13em;font-weight:850;color:#0b8c99}
.kj-map-core .kj-map-panel-heading h3{font-size:20px;margin:4px 0 0;color:#112e43}
.kj-map-core .kj-map-panel-toggle{width:30px;height:30px;border:1px solid #dce7eb;border-radius:10px;background:#fff;color:#153b50;font-size:19px;cursor:pointer}
.kj-map-core .map-search{margin:0;width:100%;border:1px solid #d9e5eb;border-radius:11px;padding:11px 12px;background:#f8fbfc}
.kj-map-core .kj-map-filter-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}
.kj-map-core .kj-map-filter{min-height:34px;padding:7px 9px;border:1px solid #dce7eb;border-radius:9px;background:#fff;color:#526b79;font-size:11px;font-weight:750;text-align:left;cursor:pointer;transition:background .15s,border-color .15s,color .15s}
.kj-map-core .kj-map-filter:hover,.kj-map-core .kj-map-filter.active{background:#123d53;border-color:#123d53;color:#fff}
.kj-map-core .kj-map-list-label{font-size:11px;font-weight:800;color:#2c5266;padding-top:2px}
.kj-map-core .location-list{flex:1;min-height:0;overflow:auto;overscroll-behavior:contain;padding-right:2px}
.kj-map-core .location-item{width:100%;text-align:left}
.kj-map-core .map-info-panel{z-index:750;top:16px;left:auto;right:16px;bottom:16px;width:min(380px,calc(100% - 390px));max-height:none;overflow:auto;border-radius:18px;box-shadow:0 16px 42px rgba(10,31,45,.2);overscroll-behavior:contain}
.kj-map-core .map-info-panel.is-open{display:grid;grid-template-rows:auto 1fr}
.kj-map-core .map-info-photo{height:clamp(100px,18vh,145px);min-height:100px}
.kj-map-core .map-info-photo img{width:100%;height:100%;object-fit:cover}
.kj-map-core .map-info-body{min-height:0}
.kj-map-core .location-item.is-selected{border-color:#0b8c99;background:#eaf8fa;box-shadow:inset 3px 0 #0b8c99}
.kj-map-core .map-info-photo{height:155px}
.kj-map-core .map-info-body{padding:15px 18px 18px}
.kj-map-core .map-info-actions{flex-wrap:wrap}
.kj-map-core .kj-map-float-panel.is-collapsed{bottom:auto;width:min(340px,calc(100% - 28px));padding:12px}
.kj-map-core .kj-map-float-panel.is-collapsed .map-search,
.kj-map-core .kj-map-float-panel.is-collapsed .kj-map-filter-grid,
.kj-map-core .kj-map-float-panel.is-collapsed .kj-map-list-label,
.kj-map-core .kj-map-float-panel.is-collapsed .location-list{display:none}
.kj-map-core .leaflet-control-zoom{margin-top:12px!important}
.kj-map-core .kj-admin-map-controls{margin-top:12px!important}
@media(max-width:900px){
 .kj-map-core{padding-top:12px!important}
 .kj-map-core .map-hero-head{width:94%;margin-bottom:10px}
 .kj-map-core .map-hero-head h1{font-size:clamp(25px,6vw,34px)}
 .kj-map-core .map-layout{height:calc(100dvh - 270px);min-height:420px}
 .kj-map-core .kj-map-float-panel{left:10px;top:10px;bottom:auto;width:min(310px,calc(100% - 20px));max-height:calc(100% - 20px);padding:12px}
 .kj-map-core .kj-map-panel-heading h3{font-size:17px}
 .kj-map-core .kj-map-filter-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
 .kj-map-core .kj-map-filter{font-size:10px;padding:6px}
 .kj-map-core .map-info-panel{left:auto;right:10px;bottom:10px;top:auto;width:min(390px,calc(100% - 20px));max-height:48%;border-radius:15px}
 .kj-map-core .map-info-panel.is-open{grid-template-rows:auto minmax(0,1fr)}
 .kj-map-core .map-info-photo{height:100px}
 .kj-map-core .map-info-body{padding:11px 13px}
 .kj-map-core .map-info-body h3{font-size:18px}
 .kj-map-core .map-info-actions-grid .map-info-btn{min-height:34px;padding:7px}
}
@media(max-width:520px){
 .kj-map-core .map-hero-head .muted{font-size:12px}
 .kj-map-core .map-layout{height:calc(100dvh - 285px);min-height:400px}
 .kj-map-core .kj-map-float-panel{max-height:44%;width:calc(100% - 20px)}
 .kj-map-core .kj-map-float-panel.is-collapsed{max-height:none}
 .kj-map-core .kj-map-filter-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
 .kj-map-core .location-list{max-height:110px}
 .kj-map-core .map-info-panel{left:10px;right:10px;bottom:10px;width:auto;max-height:44%}
 .kj-map-core .map-info-photo{height:84px;min-height:84px}
 .kj-map-core .map-info-body p{display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}
 .kj-map-core .map-info-actions-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}
}

/* V1.5: compact category panel, internal location scrolling, non-overlapping map controls */
.kj-map-core .map-search{display:none!important}
.kj-map-core .kj-map-float-panel{width:min(286px,calc(100% - 28px));padding:10px;gap:6px}
.kj-map-core .kj-map-panel-heading{gap:7px}
.kj-map-core .kj-map-panel-heading .eyebrow{font-size:8px;line-height:1.2}
.kj-map-core .kj-map-panel-heading h3{font-size:17px;margin-top:2px;line-height:1.15}
.kj-map-core .kj-map-panel-toggle{width:28px;height:28px;flex:0 0 28px}
.kj-map-core .kj-map-filter-grid{gap:4px}
.kj-map-core .kj-map-filter{min-height:29px;padding:5px 7px;font-size:10.5px}
.kj-map-core .kj-map-list-label{padding-top:1px;font-size:10.5px}
.kj-map-core .location-list{flex:1 1 0;min-height:120px;max-height:none;overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;scrollbar-gutter:stable;padding-right:4px;scrollbar-width:thin;scrollbar-color:#718894 #edf3f5}
.kj-map-core .location-list::-webkit-scrollbar{width:10px}
.kj-map-core .location-list::-webkit-scrollbar-track{background:#edf3f5;border-radius:8px}
.kj-map-core .location-list::-webkit-scrollbar-thumb{background:#718894;border:2px solid #edf3f5;border-radius:8px}
.kj-map-core .location-item-visual{min-height:48px;margin-bottom:5px}
.kj-map-core .leaflet-top.leaflet-left{left:50%;transform:translateX(-50%);display:flex;flex-direction:row;align-items:flex-start;gap:7px;z-index:800}
.kj-map-core .leaflet-top.leaflet-left .leaflet-control{margin:10px 0 0!important;clear:none}
.kj-map-core .leaflet-control-zoom{display:flex;flex-direction:column;border:1px solid rgba(18,61,83,.18)!important;border-radius:10px;overflow:hidden;box-shadow:0 4px 14px rgba(11,37,52,.15)}
.kj-map-core .leaflet-control-zoom a{width:30px!important;height:30px!important;line-height:30px!important}
.kj-map-core .kj-admin-map-controls{display:flex;align-items:center;gap:3px;padding:3px!important;margin-top:10px!important;background:rgba(255,255,255,.97);border:1px solid rgba(18,61,83,.15);border-radius:10px;box-shadow:0 4px 14px rgba(11,37,52,.15)}
.kj-map-core .kj-map-mode{width:30px;height:30px;display:flex;align-items:center;justify-content:center;padding:0;border:1px solid transparent;border-radius:7px;background:#fff;cursor:pointer}
.kj-map-core .kj-map-mode span{font-size:15px;line-height:1}
.kj-map-core .kj-map-mode.active{background:#e3f6f8;border-color:#19a8b7}
@media(max-width:900px){
 .kj-map-core .kj-map-float-panel{width:min(278px,calc(100% - 24px));padding:9px;gap:5px}
 .kj-map-core .kj-map-panel-heading h3{font-size:16px}
 .kj-map-core .kj-map-filter{min-height:28px;padding:5px 6px;font-size:10px}
 .kj-map-core .location-list{min-height:112px}
 .kj-map-core .leaflet-top.leaflet-left{left:auto;right:8px;transform:none;gap:4px}
 .kj-map-core .leaflet-top.leaflet-left .leaflet-control{margin-top:8px!important}
 .kj-map-core .leaflet-control-zoom a{width:28px!important;height:28px!important;line-height:28px!important}
 .kj-map-core .kj-map-mode{width:28px;height:28px}
}
@media(max-width:680px){
 .kj-map-core .kj-map-float-panel{width:min(270px,calc(100% - 76px));max-height:72%;padding:8px;gap:5px}
 .kj-map-core .kj-map-panel-heading .eyebrow{font-size:7.5px}
 .kj-map-core .kj-map-panel-heading h3{font-size:15px}
 .kj-map-core .kj-map-filter-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:4px}
 .kj-map-core .kj-map-filter{font-size:9.5px;min-height:27px;padding:4px 6px}
 .kj-map-core .kj-map-list-label{font-size:10px}
 .kj-map-core .location-list{min-height:100px;max-height:none}
 .kj-map-core .location-item-visual{min-height:44px}
 .kj-map-core .leaflet-top.leaflet-left{right:6px;gap:3px}
 .kj-map-core .leaflet-control-zoom a{width:26px!important;height:26px!important;line-height:26px!important}
 .kj-map-core .kj-map-mode{width:26px;height:26px}
 .kj-map-core .kj-map-mode span{font-size:13px}
}
@media(max-width:380px){
 .kj-map-core .kj-map-float-panel{width:calc(100% - 72px);max-height:74%;padding:7px}
 .kj-map-core .kj-map-filter{font-size:9px;min-height:26px;padding:4px 5px}
 .kj-map-core .location-list{min-height:90px}
}


/* V1.6 — keep map controls at upper-left, beside the category panel. */
.kj-map-core .leaflet-top.leaflet-left{
  left:12px!important;
  right:auto!important;
  top:0!important;
  transform:none!important;
  display:flex!important;
  flex-direction:row!important;
  align-items:flex-start!important;
  gap:7px!important;
  z-index:800!important;
}
.kj-map-core .leaflet-top.leaflet-left .leaflet-control{
  margin:10px 0 0!important;
  clear:none!important;
}
.kj-map-core .kj-map-float-panel{
  left:82px!important;
}
@media(max-width:900px){
  .kj-map-core .leaflet-top.leaflet-left{left:8px!important;right:auto!important;gap:4px!important}
  .kj-map-core .kj-map-float-panel{
    left:64px!important;
    width:min(278px,calc(100% - 76px))!important;
  }
}
@media(max-width:520px){
  .kj-map-core .leaflet-top.leaflet-left{left:6px!important;gap:3px!important}
  .kj-map-core .kj-map-float-panel{
    left:58px!important;
    width:calc(100% - 66px)!important;
    max-height:74%!important;
  }
}


/* V1.7: stack Leaflet zoom and basemap controls vertically at top-left.
   Keep the category panel immediately beside them, without overlap. */
.kj-map-core .leaflet-top.leaflet-left{
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  gap:8px;
}
.kj-map-core .leaflet-top.leaflet-left .leaflet-control{
  float:none;
  clear:both;
  margin:0 0 0 8px !important;
}
.kj-map-core .leaflet-top.leaflet-left .leaflet-control-zoom{
  margin-top:8px !important;
}
.kj-map-core .leaflet-top.leaflet-left .kj-admin-map-controls{
  margin-top:0 !important;
}
.kj-map-core .kj-map-float-panel{
  left:52px;
  width:min(300px,calc(100% - 64px));
}
.kj-map-core .kj-map-float-panel.is-collapsed{
  width:min(300px,calc(100% - 64px));
}
@media(max-width:900px){
  .kj-map-core .kj-map-float-panel{
    left:52px;
    width:min(290px,calc(100% - 64px));
  }
  .kj-map-core .kj-map-float-panel.is-collapsed{
    width:min(290px,calc(100% - 64px));
  }
}
@media(max-width:520px){
  .kj-map-core .kj-map-float-panel{
    left:52px;
    width:calc(100% - 64px);
  }
  .kj-map-core .kj-map-float-panel.is-collapsed{
    width:calc(100% - 64px);
  }
}


/* V1.8 FINAL CONTROL LAYOUT
   Zoom at upper-left; basemap switcher directly below; category panel beside controls.
   Deliberately overrides earlier V1.5–V1.7 positioning rules. */
.kj-map-core .map-shell { position: absolute; }

.kj-map-core .leaflet-top.leaflet-left {
  left: 8px !important;
  right: auto !important;
  top: 0 !important;
  transform: none !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  gap: 6px !important;
  z-index: 810 !important;
}
.kj-map-core .leaflet-top.leaflet-left > .leaflet-control {
  float: none !important;
  clear: none !important;
  margin: 8px 0 0 !important;
}
.kj-map-core .leaflet-top.leaflet-left > .leaflet-control-zoom {
  order: 1 !important;
  margin-top: 8px !important;
}
.kj-map-core .leaflet-top.leaflet-left > .kj-admin-map-controls {
  order: 2 !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  gap: 3px !important;
  margin-top: 0 !important;
  padding: 3px !important;
}
.kj-map-core .kj-admin-map-controls .kj-map-mode {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}
.kj-map-core .kj-map-float-panel {
  left: 58px !important;
  right: auto !important;
  width: min(286px, calc(100% - 70px)) !important;
}
.kj-map-core .kj-map-float-panel.is-collapsed {
  left: 58px !important;
  width: min(286px, calc(100% - 70px)) !important;
}
@media (max-width: 900px) {
  .kj-map-core .leaflet-top.leaflet-left {
    left: 6px !important;
    right: auto !important;
    gap: 4px !important;
  }
  .kj-map-core .kj-map-float-panel,
  .kj-map-core .kj-map-float-panel.is-collapsed {
    left: 52px !important;
    width: min(278px, calc(100% - 64px)) !important;
  }
}
@media (max-width: 520px) {
  .kj-map-core .leaflet-top.leaflet-left {
    left: 5px !important;
  }
  .kj-map-core .kj-map-float-panel,
  .kj-map-core .kj-map-float-panel.is-collapsed {
    left: 50px !important;
    width: calc(100% - 60px) !important;
    max-height: 74% !important;
  }
}
@media (max-width: 380px) {
  .kj-map-core .kj-map-float-panel,
  .kj-map-core .kj-map-float-panel.is-collapsed {
    left: 48px !important;
    width: calc(100% - 56px) !important;
  }
}
