:root{
  --bg:#ffffff;
  --text:#111;
  --muted:rgba(0,0,0,.62);
  --line:rgba(0,0,0,.10);
  --shadow: 0 10px 30px rgba(0,0,0,.12);
  --sheet-peek: 84px;
}
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial;
  background:var(--bg);
  color:var(--text);
  overflow:hidden; /* prevent page scroll; only inner panes scroll */
}

.layout{
  height:100vh;
  display:grid;
  grid-template-columns: 380px 1fr;
}
.sidebar{
  border-right:1px solid var(--line);
  overflow:hidden;
  display:flex;
  flex-direction:column;
  background:#fff;
}
.sidebar__content{display:flex;flex-direction:column;min-height:0}
.sidebar__top{padding:16px 16px 8px}
.sidebar h1{margin:0;font-size:30px;line-height:1.1}
.sidebar__controls{
  padding:8px 16px 12px;
  border-bottom:1px solid var(--line);
}
.search{
  width:100%;
  height:38px;
  border:1px solid var(--line);
  border-radius:12px;
  padding:0 12px;
  outline:none;
}
.filters{
  margin-top:8px;
  display:flex;
  flex-wrap:wrap;
  gap:6px;
}

/* badges (tags) */
.badges{
  display:flex;
  flex-wrap:wrap;
  gap:6px;
}
.badge{
  border:1px solid var(--line);
  background:rgba(0,0,0,.02);
  color:rgba(0,0,0,.78);
  border-radius:999px;
  padding:4px 9px;
  font-size:12px;
  line-height:1.2;
  white-space:nowrap;
}
.badges--mini{margin:0 0 8px}
.badges--modal{margin-top:10px}

.chip{
  border:1px solid var(--line);
  background:#fff;
  border-radius:999px;
  padding:5px 9px;
  font-size:12.5px;
  cursor:pointer;
  user-select:none;
}
.chip.is-on{background:#111;border-color:#111;color:#fff}

.list{
  overflow:auto;
  padding:10px 10px 16px;
  overscroll-behavior: contain;
}
.item{
  border:1px solid var(--line);
  border-radius:14px;
  padding:10px 10px;
  background:#fff;
  margin:8px 6px;
  cursor:pointer;
}
.item:hover{box-shadow:0 8px 18px rgba(0,0,0,.08)}
.item__coverTop{margin-bottom:10px}
.item__coverTop img{
  width:100%;
  height:160px;
  object-fit:cover;
  border-radius:12px;
  border:1px solid var(--line);
}
.item__title{font-weight:700;font-size:14px;margin-bottom:6px}
.item__addr{font-size:12.5px;color:var(--muted)}
.item__badges{margin-top:8px}
.item__actions{display:flex; gap:8px; align-items:center; margin-top:10px}

.main{position:relative}
.mapWrap{position:relative;height:100%}
.map{height:100%}

.sheetHandle{display:none}

/* Mini card */
.mini{
  position:absolute;
  transform: translate(-50%, -100%);
  z-index:1200;
  pointer-events:auto;
}
.mini[hidden]{display:none}
.mini__inner{
  width:min(420px, calc(100vw - 24px));
  background:#fff;
  border:1px solid var(--line);
  border-radius:16px;
  box-shadow:var(--shadow);
  overflow:hidden;
  position:relative;
}
.mini__close{
  position:absolute; top:8px; right:10px;
  width:34px; height:34px;
  border:0; border-radius:999px;
  background:rgba(255,255,255,.92);
  font-size:22px;
  cursor:pointer;
}
.mini__img img{display:block;width:100%;height:175px;object-fit:cover}
.mini__body{padding:12px}
.mini__title{font-weight:900;font-size:16px;margin:0 0 8px}
.mini__addr{font-size:13px;color:var(--muted);margin:0 0 10px}
.mini__actions{display:flex;gap:8px;align-items:center}
.mini__tip{
  width:14px;height:14px;
  background:#fff;
  border-left:1px solid var(--line);
  border-bottom:1px solid var(--line);
  transform: translate(-50%, -7px) rotate(45deg);
  position:absolute;
  left:50%;
  bottom:0;
}

.iconBtn{
  width:38px;height:38px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border:1px solid var(--line);
  border-radius:12px;
  background:#fff;
  text-decoration:none;
  color:#111;
  cursor:pointer;
}
.iconBtn[hidden]{display:none}
.iconBtn--close{font-size:22px; line-height:1}

.btn{
  height:38px;
  padding:0 12px;
  border:0;
  border-radius:12px;
  background:#111;
  color:#fff;
  cursor:pointer;
}

/* Modal */
.modal{
  position:absolute;
  inset:0;
  background:rgba(255,255,255,.70);
  backdrop-filter: blur(6px);
  z-index:1400;
  overflow:auto;
  overscroll-behavior: contain;
}
.modal[hidden]{display:none}
.modal__panel{
  max-width: 920px;
  margin: 18px auto;
  background:#fff;
  border:1px solid var(--line);
  border-radius:18px;
  box-shadow:var(--shadow);
  padding:18px;
}
.modal__head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
}
.mTitle{font-size:22px;font-weight:900;line-height:1.15}
.mAddr{font-size:14px;color:var(--muted);margin-top:6px}
.modal__headActions{display:flex;gap:8px; align-items:center}

.mMainImg img{
  width:100%;
  height:min(52vh, 520px);
  object-fit:cover;
  border-radius:16px;
  border:1px solid var(--line);
  margin-top:14px;
  cursor:zoom-in;
}
.mGallery{display:flex;gap:10px;overflow:auto;padding:10px 0 4px}
.mGallery img{width:110px;height:74px;object-fit:cover;border-radius:12px;border:1px solid var(--line);cursor:pointer;opacity:.95}
.mGallery img.is-on{outline:2px solid #111;opacity:1}
.mDesc{margin-top:12px;font-size:14px;color:rgba(0,0,0,.80);line-height:1.45}

/* Lightbox */
.lb{
  position:absolute;
  inset:0;
  background:rgba(0,0,0,.85);
  display:flex;
  align-items:center;
  justify-content:center;
  z-index:1500;
}
.lb[hidden]{display:none}
.lb__img{max-width:95%;max-height:92%;border-radius:14px}
.lb__close{
  position:absolute;
  top:12px; right:12px;
  width:44px; height:44px;
  border:0;
  border-radius:14px;
  background:rgba(255,255,255,.14);
  color:#fff;
  font-size:26px;
  cursor:pointer;
}

/* Monochrome PIN marker + centered cluster numbers */
.mMarker{background:transparent}
.mPin{
  width:24px;
  height:24px;
  background:#fff;
  border:2px solid rgba(0,0,0,.86);
  border-radius: 999px 999px 999px 0;
  transform: rotate(-45deg);
  box-shadow: 0 6px 14px rgba(0,0,0,.18);
  position: relative;
}
.mPin::after{
  content:"";
  width:8px;
  height:8px;
  background: rgba(0,0,0,.86);
  border-radius:999px;
  position:absolute;
  top:50%;
  left:50%;
  transform: translate(-50%,-50%) rotate(45deg);
}
.marker-cluster{background: transparent !important}
.marker-cluster div{
  width:34px !important;
  height:34px !important;
  border-radius:999px !important;
  background: rgba(0,0,0,.86) !important;
  border:2px solid rgba(255,255,255,.92) !important;
  box-shadow: 0 8px 18px rgba(0,0,0,.22) !important;
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
}
.marker-cluster span{
  color:#fff !important;
  font-weight:800 !important;
  font-size:13px !important;
  line-height:1 !important;
  display:block;
}

/* Mobile: full-screen map + bottom sheet (raised higher) */
@media (max-width: 980px){
  .layout{grid-template-columns: 1fr; height: 100dvh;}
  .main, .mapWrap, .map{height:100dvh}

  .sidebar{
    position:absolute;
    left:0; right:0;
    bottom: calc(env(safe-area-inset-bottom) + 56px); /* higher */
    top:auto;
    z-index:1300;
    border-right:none;
    border-top:1px solid var(--line);
    border-radius:18px 18px 0 0;
    box-shadow:var(--shadow);
    max-height:76dvh;
    transform: translateY(calc(100% - var(--sheet-peek)));
    transition: transform .18s ease;
  }
  .sidebar.is-open{transform: translateY(0);}

  .sheetHandle{
    display:block;
    padding:8px 12px 12px;
    border-bottom:1px solid var(--line);
    background:#fff;
  }
  .sheetHandle__bar{
    width:44px;height:5px;border-radius:999px;
    background:rgba(0,0,0,.18);
    margin:0 auto 8px;
  }
  .sheetHandle__row{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:10px;
  }
  .sheetHandle__title{
    font-weight:750;
    font-size:13px;
    color:rgba(0,0,0,.72);
    letter-spacing:.2px;
  }
  .sheetHandle__btn{
    width:38px;height:34px;
    border:1px solid var(--line);
    border-radius:12px;
    background:#fff;
    cursor:pointer;
    font-size:16px;
    color:#111; /* black arrow */
  }

  .sidebar__top{padding:12px 16px 6px}
  .sidebar h1{font-size:22px}
  .modal__panel{margin:10px 10px 16px}
  .mMainImg img{height: min(40vh, 420px)}
}