html, body {
    height: 100%;
    margin: 0;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  }
  
  .topbar{
    height: 48px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 12px;
    border-bottom: 1px solid #ddd;
    background: #fafafa;
  }
  
  .chip{
    font-size: 12px;
    opacity: .85;
    padding: 6px 10px;
    border: 1px solid #e5e5e5;
    background: #fff;
    border-radius: 999px;
  }
  
  .status{
    margin-left: auto;
    font-size: 12px;
    opacity: .85;
  }
  
  .btn{
    border: 1px solid #ddd;
    background: #fff;
    padding: 7px 10px;
    border-radius: 10px;
    cursor: pointer;
  }
  .btn:hover{ background:#f6f6f6; }
  .btn-ghost{
    background: transparent;
  }
  
  .filters{
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 12px;
    border-bottom: 1px solid #ddd;
    background: #fff;
    flex-wrap: wrap;
  }
  
  .filters__left{
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
  }
  
  .filters__title{
    font-size: 12px;
    opacity: .75;
    text-transform: uppercase;
    letter-spacing: .06em;
  }
  
  .filters__list{
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
  }
  
  .filter-item{
    display: inline-flex;
    align-items: center;
    gap: 6px;
    user-select: none;
  }
  
  .filter-item input{
    display: none;
  }
  
  .filter-pill{
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid #e5e5e5;
    background: #fafafa;
    font-size: 13px;
    cursor: pointer;
  }
  
  .filter-pill__icon{
    width: 18px;
    text-align: center;
  }
  
  .filter-item input:checked + .filter-pill{
    background: #fff;
    border-color: #cfcfcf;
    box-shadow: 0 1px 0 rgba(0,0,0,.03);
  }
  
  #map{
    height: calc(100% - 48px - 58px); /* topbar + filters (approx) */
  }
  
  /* =========================
     Marker Icons (divIcon)
     ========================= */
  .pin-icon{
    width: 26px;
    height: 26px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    border: 2px solid #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,.15);
    background: #111; /* default, can be overridden */
  }
  .pin-icon__glyph{
    font-size: 14px;
    line-height: 1;
    filter: drop-shadow(0 1px 0 rgba(0,0,0,.2));
  }
  
  /* A few common category colors (optional, safe defaults) */
  .pin-icon--weapons{ background:#2b2b2b; }
  .pin-icon--security{ background:#1f2a44; }
  .pin-icon--medical{ background:#2a4a2f; }
  .pin-icon--ammo{ background:#4a2a2a; }
  .pin-icon--electronics{ background:#3b2a4a; }
  .pin-icon--crate{ background:#3b3b2a; }
  .pin-icon--basket{ background:#2a3b3b; }
  .pin-icon--husk{ background:#3a2a2a; }
  .pin-icon--default{ background:#111; }
  
  /* =========================
     Popup styling (scroll-safe)
     ========================= */
  .popup{
    max-width: 340px;
  }
  .popup__title{
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
  }
  .popup__emoji{
    font-size: 16px;
  }
  .popup__meta{
    font-size: 12px;
    line-height: 1.35;
    margin-bottom: 8px;
  }
  .popup__controls{
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 8px;
  }
  .popup__label{
    font-size: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
  }
  .popup__select{
    font-size: 13px;
    padding: 6px 8px;
    border-radius: 10px;
    border: 1px solid #ddd;
    background: #fff;
  }
  
  .popup__loot{
    max-height: 220px;
    overflow: auto;
    border-top: 1px solid #eee;
    padding-top: 8px;
  }
  
  .loot-list{
    list-style: none;
    padding: 0;
    margin: 0;
  }
  .loot-list li{
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 4px 0;
    border-bottom: 1px dashed #f0f0f0;
  }
  .loot-name{
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 220px;
  }
  .loot-qty{
    opacity: .85;
  }
  
  .muted{
    opacity: .7;
    font-size: 12px;
  }
  
  /* =========================
     Draft editor styling
     ========================= */
  .draft{
    max-width: 360px;
  }
  .draft__top{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:10px;
  }
  .icon-btn{
    border: 0;
    background: transparent;
    cursor: pointer;
    font-size: 16px;
  }
  .draft__coords{
    margin: 6px 0;
    font-size: 12px;
    opacity: .8;
  }
  .draft__label{
    display:block;
    font-size: 12px;
    margin-top: 8px;
  }
  .draft__input{
    width: 100%;
    padding: 7px 8px;
    border-radius: 10px;
    border: 1px solid #ddd;
  }
  .draft__out{
    margin-top: 6px;
    width: 100%;
    height: 120px;
    font-size: 11px;
  }
  