/* «Карта инициатив» — Figma: Ma8ka Map 1 Users / 1.1 Users Card (#1450:30778) */
.nav a.is-current { position: relative; color: var(--ink); }
.nav a.is-current::after { content: ""; position: absolute; left: 50%; bottom: -10px; width: 6px; height: 6px;
  margin-left: -3px; border-radius: 50%; background: var(--brand); }

.imap { padding-top: 48px; }
.imap__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; margin-bottom: 36px; }
.imap__head h1 { font-size: 48px; font-weight: 800; letter-spacing: -.01em; margin: 0 0 14px; }
.imap__head p { color: var(--muted); font-size: 18px; line-height: 1.45; margin: 0; }

.imap__city { position: relative; display: grid; grid-template-columns: 1fr 24px; column-gap: 12px; align-items: center;
  min-width: 294px; background: #F2F2F2; border-radius: var(--r-md); padding: 16px 0 16px 20px; cursor: pointer; }
.imap__city b { font-size: 15px; font-weight: 500; margin-bottom: 10px; }
.imap__faces { grid-column: 1; display: flex; align-items: center; min-height: 30px; }
.imap__faces .ava { width: 30px; height: 30px; margin-left: -8px; border: 2px solid #F2F2F2; font-size: 12px; }
.imap__faces .ava:first-child { margin-left: 0; }
.imap__faces small { margin-left: 10px; color: var(--ink-2); font-size: 13px; }
.imap__chev { grid-column: 2; grid-row: 1 / 3; align-self: stretch; display: grid; place-items: center;
  background: #E6E6E6; border-radius: 0 var(--r-md) var(--r-md) 0; margin: -16px 0; color: var(--muted); }
.imap__city select, .imap__where select, .imap__sort select {
  position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; font: inherit; }

.imap__bar { display: flex; justify-content: space-between; align-items: center; gap: 24px; margin-bottom: 28px; flex-wrap: wrap; }
.imap__tabs { display: flex; gap: 40px; }
.imap__tabs button { background: none; border: 0; padding: 0; font: inherit; font-size: 32px; font-weight: 500;
  color: #AEB6BE; cursor: pointer; transition: color .15s; }
.imap__tabs button:hover { color: var(--muted); }
.imap__tabs button.is-active { color: var(--brand); }
.imap__search { display: flex; align-items: center; width: 486px; max-width: 100%; height: 68px;
  background: #F2F2F2; border-radius: var(--r-md); padding: 0 22px; color: var(--muted); }
.imap__search input { flex: 1; min-width: 0; border: 0; background: none; font: inherit; font-size: 18px; outline: none; }
.imap__search input::-webkit-search-cancel-button { display: none; }

/* stage: full-bleed map with a frosted side panel */
.imap__stage { position: relative; height: 800px; background: #EDEDED; }
#imap-map { position: absolute; inset: 0; z-index: 1; }
#imap-map .leaflet-tile-pane { filter: saturate(.5) brightness(1.04) contrast(.95); }
.imap__panel { position: absolute; z-index: 500; top: 0; left: 0; bottom: 0; width: 360px; padding: 20px;
  display: flex; flex-direction: column; gap: 20px;
  background: rgba(190, 196, 202, .45); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  border-radius: 0 var(--r-lg) var(--r-lg) 0; }
.imap__where, .imap__sort { position: relative; display: flex; align-items: center; justify-content: space-between;
  gap: 8px; border-radius: var(--pill); color: var(--muted); font-size: 14px; cursor: pointer; }
.imap__where { height: 40px; padding: 0 22px; background: rgba(255,255,255,.7); }
.imap__sort { align-self: flex-start; height: 40px; padding: 0 20px; background: rgba(255,255,255,.55); margin-bottom: 16px; }
#imap-listview { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.imap__list { display: flex; flex-direction: column; gap: 10px; overflow-y: auto; min-height: 0; padding-right: 2px; }
.imap__row { display: flex; align-items: center; gap: 10px; background: #fff; border-radius: var(--r-md);
  min-height: 68px; padding: 10px 14px 10px 16px; cursor: pointer; border: 1.5px solid transparent; transition: border-color .15s; }
.imap__row:hover, .imap__row.is-active { border-color: var(--brand); }
.imap__row .ava { width: 36px; height: 36px; font-size: 15px; }
.imap__row-name { flex: 1; min-width: 0; font-size: 16px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.imap__empty { background: #fff; border-radius: var(--r-md); padding: 16px; font-size: 14px; color: var(--muted); line-height: 1.45; }

.ava { flex: none; width: 40px; height: 40px; border-radius: 50%; background: var(--brand-l); color: var(--brand);
  display: grid; place-items: center; font-weight: 700; overflow: hidden; }
.ava img { width: 100%; height: 100%; object-fit: cover; }

.pills { display: inline-flex; align-items: center; gap: 8px; background: #F2F2F2; border-radius: var(--pill);
  padding: 5px 10px; font-size: 13px; color: var(--muted); white-space: nowrap; }
.pill { display: inline-flex; align-items: center; gap: 3px; }
.pill svg { flex: none; }
.pill--like svg { color: #E0474C; }
.pill--bolt svg { color: #EBB400; }
.pill--blue svg { color: var(--brand); }

/* user card */
.imap__card { flex: 1; min-height: 0; background: #fff; border-radius: var(--r-lg); padding: 20px 18px; overflow-y: auto; font-size: 14px; }
.imap__back { display: inline-flex; align-items: center; gap: 8px; background: none; border: 0; padding: 0; font: inherit;
  font-size: 14px; color: var(--muted-2); cursor: pointer; margin-bottom: 18px; }
.imap__back:hover { color: var(--brand); }
.imap__box { background: #fff; border-radius: var(--r-md); box-shadow: 0 2px 14px rgba(0,0,0,.07); padding: 16px; margin-bottom: 22px; }
.imap__who { display: flex; gap: 16px; align-items: center; margin-bottom: 16px; }
.imap__who .ava { width: 56px; height: 56px; font-size: 22px; }
.imap__who b { display: block; font-size: 16px; font-weight: 500; margin-bottom: 6px; }
.imap__who .pills { background: none; padding: 0; }
.imap__meta { color: var(--muted); font-size: 13px; margin: -6px 0 14px; }
.imap__act { display: flex; align-items: center; justify-content: space-between; height: 38px; padding: 0 22px;
  border-radius: var(--pill); font-size: 14px; font-weight: 500; margin-top: 10px; }
.imap__act--blue { background: #D9E9F5; color: var(--brand); }
.imap__act--gray { background: #EDEDED; color: var(--muted); }
.imap__act:hover { filter: brightness(.96); }
.imap__card h4 { font-size: 16px; font-weight: 500; margin: 0 0 10px; }
.imap__card h4 span { color: var(--muted); font-weight: 400; }
.imap__card p { color: var(--muted); font-size: 12.5px; line-height: 1.5; margin: 0 0 12px; }
.imap__tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.imap__tags span { background: #F2F2F2; border-radius: var(--pill); padding: 6px 10px; font-size: 12px; color: var(--ink-2); }
.imap__proj { display: block; background: #F2F2F2; border-radius: var(--r-md); padding: 12px 14px; margin-bottom: 10px; color: var(--ink); }
.imap__proj:hover { background: var(--brand-l); }
.imap__proj b { display: block; font-size: 14px; font-weight: 400; margin-bottom: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.imap__proj .pills { background: none; padding: 0; gap: 14px; }

/* markers */
.imap-pin { background: none; border: 0; }
.imap-pin .halo { display: grid; place-items: center; width: 76px; height: 76px; border-radius: 50%;
  background: rgba(38,125,183,.22); transition: background .15s; }
.imap-pin .ava { width: 56px; height: 56px; border: 3px solid #fff; box-shadow: var(--shadow-sm); font-size: 20px; }
.imap-pin.is-active .halo, .imap-pin:hover .halo { background: rgba(38,125,183,.45); }
.imap-pin--proj .ava { border-radius: 16px; }
.leaflet-container { font-family: var(--font); }

/* top */
.imap__top { background: #F2F2F2; border-radius: var(--r-lg); padding: 30px; margin-top: 30px; }
.imap__top-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 22px; }
.imap__top-head h2 { font-size: 20px; font-weight: 500; margin: 0; }
.imap__all { background: none; border: 0; font: inherit; font-size: 14px; color: var(--muted-2); text-decoration: underline;
  text-underline-offset: 3px; cursor: pointer; }
.imap__all:hover { color: var(--brand); }
.imap__grid { display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, auto);
  grid-auto-flow: column; gap: 20px 30px; }
.imap__cell { display: flex; align-items: center; gap: 10px; background: #E3E4E6; border-radius: var(--r-md);
  min-height: 68px; padding: 10px 14px; cursor: pointer; transition: background .15s; }
.imap__cell:hover { background: #D9E9F5; }
.imap__num { flex: none; width: 24px; height: 24px; border-radius: 50%; background: #fff; display: grid; place-items: center;
  color: var(--muted); font-size: 12px; }
.imap__cell .ava { width: 36px; height: 36px; font-size: 14px; }
.imap__cell .pills { background: #fff; }
.imap__hint { text-align: center; color: var(--muted); font-size: 14px; margin: 24px 0 56px; }

#imap-listview[hidden], .imap__card[hidden] { display: none !important; }

@media (max-width: 1100px) {
  .imap__grid { grid-template-columns: repeat(2, 1fr); grid-template-rows: none; grid-auto-flow: row; }
  .imap__search { width: 100%; }
}
@media (max-width: 760px) {
  .imap { padding-top: 28px; }
  .imap__head { flex-direction: column; margin-bottom: 24px; }
  .imap__head h1 { font-size: 32px; }
  .imap__head p { font-size: 15px; }
  .imap__head p br { display: none; }
  .imap__city { width: 100%; min-width: 0; }
  .imap__tabs { gap: 20px; }
  .imap__tabs button { font-size: 21px; }
  .imap__search { height: 52px; }
  .imap__stage { height: auto; background: none; }
  #imap-map { position: relative; height: 60vh; }
  .imap__panel { position: static; width: auto; border-radius: 0; background: #EDEDED;
    -webkit-backdrop-filter: none; backdrop-filter: none; }
  .imap__list { max-height: 360px; }
  .imap__card { max-height: none; }
  .imap__grid { grid-template-columns: 1fr; }
  .imap__top { padding: 20px 16px; }
}

/* «Проекты» / «Товары»: square pictures, two-line titles (Figma: Map Товары) */
.ava--sq { border-radius: 10px; background: #fff; }
.ava--sq img { object-fit: contain; padding: 2px; }
.imap__row .ava--sq, .imap__cell .ava--sq { width: 40px; height: 40px; box-shadow: 0 0 0 1px var(--line); }
.imap__row:has(.ava--sq) .imap__row-name, .imap__cell:has(.ava--sq) .imap__row-name {
  white-space: normal; font-size: 14px; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.imap-pin .ava--sq { border-radius: 12px; border: 0; }
/* Leaflet resets marker images to width:auto — keep avatars/thumbnails fitted */
.leaflet-container .leaflet-marker-pane .imap-pin img { width: 100%; height: 100%; }
.leaflet-container .leaflet-marker-pane .imap-pin .ava--sq img { padding: 2px; }
