/* EAI City — «Карта города» (v7.2, js/ui/map.js). Classes: mp-. Built on the tokens of css/eai.css.
   A calm cartographic look in the app's palette: warm paper streets, sage forest, petrol-tinted water, gold for the main
   streets and the square; pins in each building's calm colour with soft shadows. Night palette (.is-dark) for the
   city's evening / night or a dark system theme. Desktop: a side panel with the legend; phones: a bottom sheet. */

.mp {
  /* the map: day */
  --m-forest: #c6d4b2; --m-cn1: #b8c9a2; --m-cn2: #d1dcbf; --m-meadow: #dde5cb;
  --m-ground: #e9e2d5; --m-walk: #f3eee5; --m-block: #e7decf; --m-old: #ecdcc2; --m-citi: #dcdfe1; --m-citi-plaza: #e3e5e4;
  --m-park: #c3d6ad; --m-plot: #d9e3c3; --m-sand: #ecdfbb; --m-priv: #e3e3cc; --m-new: #e4dfd6;
  --m-plaza: #f0deb1; --m-plaza-edge: #d8bd7d;
  --m-house: #d5c8b3; --m-house-edge: #c2b39b; --m-shadow: rgba(92, 72, 40, 0.16); --m-tower: #c9d0d6; --m-tower-edge: #a8b2ba;
  --m-water: #a7cdd5; --m-shore: #8dbcc7; --m-water-ink: #3f7b88;
  --m-road: #ffffff; --m-road-edge: #d6cab6; --m-major: #fbf2db; --m-major-edge: #d9c393; --m-hwy: #f3dca2; --m-hwy-edge: #c4a35e; --m-bridge: #a99a82;
  --m-median: #b6cc9b; --m-pole: #8a7a5c;
  --m-apron: #d9d5cc; --m-taxi: #c9c4b9; --m-runway: #8e9398; --m-mark: #ffffff; --m-pitch: #9fc38a; --m-wood: #a7835a;
  --m-tree: #9cb784;
  --m-label: #6f6658; --m-halo: rgba(250, 247, 241, 0.92); --m-forest-ink: #6a7f57; --m-road-ink: #8a6d31;
  --m-pill: rgba(255, 255, 255, 0.94); --mp-panel: var(--panel);
  position: fixed; inset: 0; z-index: 50; overflow: hidden; color: var(--ink); font-family: var(--font);
  opacity: 0; transition: opacity 0.24s var(--ease);
}
.mp[hidden] { display: none !important; }
.mp.in { opacity: 1; }
.mp.out { opacity: 0; transition-duration: 0.18s; }
.mp [hidden] { display: none !important; }
.mp.is-dark {
  /* the map: night */
  --m-forest: #13221d; --m-cn1: #172a23; --m-cn2: #0f1d18; --m-meadow: #1a2a23;
  --m-ground: #1b252b; --m-walk: #222d33; --m-block: #1a232a; --m-old: #221f1b; --m-citi: #1b2530; --m-citi-plaza: #1f2a33;
  --m-park: #183128; --m-plot: #1c2f27; --m-sand: #2a2820; --m-priv: #1d2622; --m-new: #1d232b;
  --m-plaza: #3a311e; --m-plaza-edge: #7a6534;
  --m-house: #2b3740; --m-house-edge: #34424d; --m-shadow: rgba(0, 0, 0, 0.38); --m-tower: #34424f; --m-tower-edge: #4d5f6e;
  --m-water: #0f3640; --m-shore: #17505e; --m-water-ink: #7fb6c2;
  --m-road: #3b4850; --m-road-edge: #10171b; --m-major: #4d5961; --m-major-edge: #0c1215; --m-hwy: #5c5236; --m-hwy-edge: #0c1215; --m-bridge: #55606a;
  --m-median: #24402f; --m-pole: #c9a35a;
  --m-apron: #29323a; --m-taxi: #323c45; --m-runway: #3d454c; --m-mark: #c9cfd4; --m-pitch: #22492f; --m-wood: #6b5235;
  --m-tree: #1f3b2e;
  --m-label: #a3b0b6; --m-halo: rgba(10, 16, 20, 0.88); --m-forest-ink: #6f8f78; --m-road-ink: #c9a35a;
  --m-pill: rgba(20, 28, 34, 0.92);
  /* the panel follows the night */
  --ink: #edf1f2; --ink2: #b6c1c6; --ink3: #8d99a0; --panel: #131b21; --panel2: #19232b; --panel3: #212c35; --mp-panel: #131b21;
  --line: #25313b; --line2: #33424d; --hair: rgba(255, 255, 255, 0.08);
  --glass: rgba(19, 27, 33, 0.84); --glass-strong: rgba(19, 27, 33, 0.94); --glass-line: rgba(255, 255, 255, 0.09);
  --gold-l: rgba(201, 163, 90, 0.18); --gold-t: #e3c88e; --primary-l: rgba(95, 176, 189, 0.16);
  color-scheme: dark;
}

/* ---------------------------------------------------------------- the map itself */
.mp-stage { position: absolute; inset: 0; overflow: hidden; touch-action: none; cursor: grab; background: var(--m-forest); outline: none; transform: scale(1.03); transition: transform 0.55s var(--ease); -webkit-user-select: none; user-select: none; }
.mp.in .mp-stage { transform: none; }
.mp.is-dragging .mp-stage { cursor: grabbing; }
.mp-stage:focus-visible { box-shadow: inset 0 0 0 3px var(--primary); }
.mp-svg { position: absolute; left: 0; top: 0; width: 100%; height: 100%; display: block; transform-origin: 0 0; } /* (map.js sizes it 20 % past every edge and slides it while it moves) */
.mp-forest { fill: var(--m-forest); }
.mp-cn1 { fill: var(--m-cn1); } .mp-cn2 { fill: var(--m-cn2); }
.mp-clear { fill: none; stroke: var(--m-meadow); stroke-linecap: round; stroke-linejoin: round; }
.mp-ground { fill: var(--m-ground); }
.mp-water { fill: var(--m-water); }
.mp-shore { fill: none; stroke: var(--m-shore); stroke-width: 2.4; stroke-linejoin: round; }
.mp-walk { fill: var(--m-walk); }
.mp-lot { fill: var(--m-block); }
.mp-lot.d-old, .mp-lot.d-sq, .mp-lot.d-fun { fill: var(--m-old); }
.mp-lot.d-citi { fill: var(--m-citi); }
.mp-lot.d-green { fill: var(--m-park); }
.mp-lot.d-priv { fill: var(--m-priv); }
.mp-lot.d-new { fill: var(--m-new); }
.mp-lot.d-air { fill: var(--m-apron); }
.mp-park { fill: var(--m-park); } .mp-sand { fill: var(--m-sand); } .mp-plot { fill: var(--m-plot); } .mp-path { fill: var(--m-walk); }
.mp-plaza { fill: var(--m-plaza); stroke: var(--m-plaza-edge); stroke-width: 1.2; stroke-linejoin: round; }
.mp-fountain { stroke: var(--m-plaza-edge); stroke-width: 1.6; }
.mp-apron { fill: var(--m-apron); }
.mp-taxi { fill: none; stroke: var(--m-taxi); stroke-linecap: round; stroke-linejoin: round; }
.mp-runway { fill: none; stroke: var(--m-runway); stroke-linecap: butt; }
.mp-runway-mark { fill: none; stroke: var(--m-mark); stroke-width: 1.6; stroke-dasharray: 16 12; }
.mp-runway-edge { fill: none; stroke: var(--m-mark); stroke-width: 1; opacity: 0.75; }
.mp-lm { fill: var(--ll); stroke: var(--lc); stroke-width: 1.4; stroke-linejoin: round; }
.mp.is-dark .mp-lm { fill: var(--ld); stroke: var(--lm); }
.mp-lm-line { fill: none; stroke: var(--lc); stroke-linecap: round; }
.mp-lm-sh, .mp-house-sh { fill: var(--m-shadow); }
.mp-house { fill: var(--m-house); stroke: var(--m-house-edge); stroke-width: 0.6; stroke-linejoin: round; }
.mp-tower { fill: var(--m-tower); stroke: var(--m-tower-edge); stroke-width: 1.4; }
.mp-citi { fill: var(--m-citi-plaza); }
.mp-pitch { fill: var(--m-pitch); }
.mp-pitch-line { fill: none; stroke: rgba(255, 255, 255, 0.75); stroke-width: 1.2; }
.mp-wheel { fill: none; stroke: var(--lc); stroke-width: 2.4; }
.mp-pier { fill: none; stroke: var(--m-wood); stroke-linecap: butt; }
.mp-path-line { fill: none; stroke: var(--m-walk); stroke-linecap: round; stroke-linejoin: round; }
.mp-road-cas { fill: none; stroke: var(--m-road-edge); stroke-linecap: round; stroke-linejoin: round; }
.mp-road-cas.mp-major { stroke: var(--m-major-edge); }
.mp-road-cas.mp-hwy { stroke: var(--m-hwy-edge); }
.mp-road-cas.mp-bridge { stroke: var(--m-bridge); stroke-linecap: butt; }
.mp-road { fill: none; stroke: var(--m-road); stroke-linecap: round; stroke-linejoin: round; }
.mp-road.mp-major { stroke: var(--m-major); }
.mp-road.mp-hwy { stroke: var(--m-hwy); }
.mp-median { fill: none; stroke: var(--m-median); stroke-linecap: round; stroke-linejoin: round; }
.mp-pole { fill: var(--m-pole); }
.mp-trees { fill: var(--m-tree); opacity: 0; visibility: hidden; transition: opacity 0.3s ease, visibility 0.3s; }
.mp.z-trees .mp-trees { opacity: 0.9; visibility: visible; }

/* ---------------------------------------------------------------- labels over the map (HTML: crisp at any zoom) */
.mp-labels, .mp-pins { position: absolute; inset: 0; pointer-events: none; }
.mp-lbl { position: absolute; left: 0; top: 0; white-space: nowrap; font-size: 0.78rem; font-weight: 800; letter-spacing: 0.16em; text-transform: uppercase; line-height: 1; color: var(--m-label);
  text-shadow: 0 0 2px var(--m-halo), 0 0 5px var(--m-halo), 0 0 9px var(--m-halo); will-change: transform; transition: opacity 0.2s ease; }
.mp-lbl.is-water { font-family: var(--display); font-style: italic; font-weight: 600; font-size: 1.05rem; letter-spacing: 0.08em; text-transform: none; color: var(--m-water-ink); }
.mp-lbl.is-forest { color: var(--m-forest-ink); letter-spacing: 0.4em; }
.mp-lbl.is-road { color: var(--m-road-ink); letter-spacing: 0.22em; }

/* ---------------------------------------------------------------- pins: the place's colour, its line icon, a soft shadow */
.mp-pin { position: absolute; left: 0; top: 0; width: 40px; height: 40px; margin: -52px 0 0 -20px; padding: 0; border: 0; border-radius: 50%; background: none; color: #fff;
  pointer-events: auto; cursor: pointer; will-change: transform; z-index: 1; -webkit-tap-highlight-color: transparent; }
.mp-pin::before { content: ''; position: absolute; left: 50%; top: 32px; width: 13px; height: 13px; margin-left: -6.5px; transform: rotate(45deg); border-radius: 0 0 4px 0;
  background: var(--pc-d); border: solid #fff; border-width: 0 2.5px 2.5px 0; box-shadow: 3px 3px 6px rgba(16, 22, 28, 0.22); }
.mp-pin__head { position: absolute; inset: 0; border-radius: 50%; display: grid; place-items: center; color: #fff; border: 2.5px solid #fff;
  background: radial-gradient(120% 120% at 30% 18%, var(--pc-l) -70%, var(--pc) 52%, var(--pc-d) 118%);
  box-shadow: 0 7px 16px rgba(16, 22, 28, 0.26), 0 1px 3px rgba(16, 22, 28, 0.3); transform-origin: 50% 120%; transition: transform 0.2s var(--ease), box-shadow 0.2s ease; }
.mp-pin__head .ico { width: 19px; height: 19px; }
.mp.in .mp-pin__head { animation: mpPop 0.46s var(--ease) both; animation-delay: calc(var(--i, 0) * 16ms + 90ms); }
.mp-pin__lbl { position: absolute; left: 50%; top: 56px; transform: translateX(-50%); white-space: nowrap; padding: 4px 10px; border-radius: 999px; background: var(--m-pill); color: var(--ink);
  font-size: 0.8rem; font-weight: 700; line-height: 1.2; box-shadow: 0 2px 8px rgba(16, 22, 28, 0.16), 0 0 0 1px rgba(16, 22, 28, 0.05); pointer-events: none; transition: opacity 0.16s ease; }
.mp-pin.lbl-r .mp-pin__lbl { left: calc(100% + 4px); top: 9px; transform: none; }
.mp-pin.lbl-l .mp-pin__lbl { left: auto; right: calc(100% + 4px); top: 9px; transform: none; }
.mp-pin.no-lbl:not(.is-hot):not(:hover):not(:focus-visible) .mp-pin__lbl { opacity: 0; visibility: hidden; } /* (never «visible»: a hidden pin keeps its label hidden) */
.mp-pin:hover, .mp-pin.is-hot, .mp-pin:focus-visible { z-index: 3; }
.mp-pin:hover .mp-pin__head, .mp-pin.is-hot .mp-pin__head { transform: scale(1.1); }
.mp-pin:focus-visible { outline: none; }
.mp-pin:focus-visible .mp-pin__head { box-shadow: 0 0 0 3px var(--primary), 0 7px 16px rgba(16, 22, 28, 0.26); }
.mp-pin.is-sel { z-index: 4; }
.mp-pin.is-sel .mp-pin__head { transform: scale(1.2); box-shadow: 0 0 0 5px var(--pc-l), 0 10px 22px rgba(16, 22, 28, 0.32); }
.mp-pin.is-sel::after { content: ''; position: absolute; left: 50%; top: 52px; width: 18px; height: 8px; margin: -4px 0 0 -9px; border-radius: 50%; background: var(--pc); opacity: 0.45; animation: mpRing 1.8s ease-out infinite; }
.mp-pin.is-sel .mp-pin__lbl { top: 60px; background: var(--ink); color: var(--panel); }
.mp.is-dark .mp-pin.is-sel .mp-pin__lbl { background: #edf1f2; color: #131b21; }
.mp-pin.k-ad .mp-pin__head { width: 34px; height: 34px; inset: 3px; }
.mp-pin.k-ad .mp-pin__head .ico { width: 16px; height: 16px; }
/* a cluster: several places too close at this zoom — the count, a stacked look; a tap zooms in */
.mp-pin.is-cluster { width: 46px; height: 46px; margin: -56px 0 0 -23px; }
.mp-pin.is-cluster::before { top: 37px; background: var(--primary-d); }
.mp-pin.is-cluster .mp-pin__head { background: radial-gradient(120% 120% at 30% 18%, #2f7d8a -20%, #14505c 55%, #0b3039 120%); box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.45), 0 0 0 5px rgba(20, 80, 92, 0.25), 0 8px 18px rgba(16, 22, 28, 0.3); }
.mp-pin.is-cluster .mp-pin__head .ico { display: none; }
.mp-pin.is-cluster .mp-pin__lbl { top: 60px; }
.mp-pin.is-cluster::after { content: attr(data-n); position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 1.12rem; z-index: 2; pointer-events: none; }

/* «Вы здесь» carried by the pin the avatar stands at (the door of a building, the square under the «Площадь» bubble) */
.mp-pin__me { display: none; position: absolute; left: 50%; bottom: calc(100% + 9px); transform: translateX(-50%); align-items: center; gap: 6px; padding: 3px 11px 3px 3px; border-radius: 999px;
  background: var(--primary); color: #fff; white-space: nowrap; font-size: 0.78rem; font-weight: 800; line-height: 1.2; box-shadow: 0 3px 10px rgba(13, 60, 70, 0.32); pointer-events: none; }
.mp-pin__me::after { content: ''; position: absolute; left: 50%; top: 100%; margin-left: -5px; border: 5px solid transparent; border-top-color: var(--primary); }
.mp-pin__meface { width: 22px; height: 22px; border-radius: 50%; overflow: hidden; display: grid; place-items: center; background: var(--panel3); box-shadow: 0 0 0 2px var(--gold); }
.mp-pin__meface .ava { width: 100%; height: 100%; border: 0; box-shadow: none; }
.mp-pin.has-me { z-index: 4; }
.mp-pin.has-me .mp-pin__me { display: inline-flex; }
.mp-pin.has-me .mp-pin__head { box-shadow: 0 0 0 3px var(--gold), 0 7px 16px rgba(16, 22, 28, 0.26), 0 0 0 9px rgba(201, 163, 90, 0.22); }
.mp-pin.has-me .mp-pin__head::before { content: ''; position: absolute; inset: -6px; border-radius: 50%; border: 3px solid rgba(201, 163, 90, 0.7); animation: mpHalo 2.2s ease-out infinite; pointer-events: none; }

/* «Вы здесь»: the resident's own face in a gold ring with a slow pulse */
.mp-me { position: absolute; left: 0; top: 0; width: 34px; height: 34px; margin: -17px 0 0 -17px; padding: 0; border: 0; border-radius: 50%; background: none; z-index: 5; pointer-events: auto; cursor: pointer; will-change: transform; -webkit-tap-highlight-color: transparent; }
.mp-me__pulse { position: absolute; inset: 0; border-radius: 50%; background: rgba(201, 163, 90, 0.5); animation: mpPulse 2.2s ease-out infinite; }
.mp-me__dot { position: absolute; inset: 0; border-radius: 50%; overflow: hidden; display: grid; place-items: center; background: var(--panel3); border: 3px solid var(--gold); box-shadow: 0 0 0 2px #fff, 0 5px 14px rgba(16, 22, 28, 0.34); }
.mp-me__dot .ava { width: 100%; height: 100%; border: 0; box-shadow: none; border-radius: 50%; }
.mp-me__tag { position: absolute; left: 50%; bottom: calc(100% + 7px); transform: translateX(-50%); white-space: nowrap; padding: 4px 10px; border-radius: 999px; background: var(--primary); color: #fff; font-size: 0.78rem; font-weight: 800; line-height: 1.2; box-shadow: 0 3px 10px rgba(13, 60, 70, 0.32); }
.mp-me__tag::after { content: ''; position: absolute; left: 50%; top: 100%; margin-left: -5px; border: 5px solid transparent; border-top-color: var(--primary); }
.mp-me.is-sel .mp-me__dot { box-shadow: 0 0 0 2px #fff, 0 0 0 7px rgba(201, 163, 90, 0.4), 0 6px 16px rgba(16, 22, 28, 0.36); }
.mp-me:focus-visible { outline: none; } .mp-me:focus-visible .mp-me__dot { box-shadow: 0 0 0 3px var(--primary); }

/* ---------------------------------------------------------------- the top bar: the title (phones), close */
.mp-top { position: absolute; z-index: 6; top: calc(16px + env(safe-area-inset-top, 0px)); right: calc(16px + env(safe-area-inset-right, 0px)); display: flex; align-items: center; gap: 10px; pointer-events: none; }
.mp-top > * { pointer-events: auto; }
.mp-top__title { display: none; }
.mp-close, .mp-top__title, .mp-cbtn, .mp-scale__bar, .mp-compass { background: var(--glass-strong); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); border: 1px solid var(--glass-line); box-shadow: var(--sh-glass); }
.mp-close { display: inline-flex; align-items: center; gap: 8px; height: 50px; padding: 0 18px 0 14px; border-radius: 15px; color: var(--ink); font-weight: 700; font-size: 1rem; transition: background-color 0.15s ease; }
.mp-close:hover { background: var(--panel); }
.mp-close .ico { width: 20px; height: 20px; }

/* ---------------------------------------------------------------- the legend: a side panel (desktop) */
.mp-panel { position: absolute; z-index: 6; left: calc(16px + env(safe-area-inset-left, 0px)); top: 16px; bottom: 16px; width: 380px; display: flex; flex-direction: column;
  background: var(--mp-panel); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--sh-3); overflow: hidden;
  opacity: 0; transform: translateX(-14px); transition: opacity 0.3s ease 0.05s, transform 0.42s var(--ease) 0.05s; }
.mp.in .mp-panel { opacity: 1; transform: none; }
.mp-grip { display: none; }
.mp-panel__head { flex: none; display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; padding: 22px 24px 8px; }
.mp-panel__ttl { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mp-panel__ttl h2 { font: 700 1.65rem/1.15 var(--display); color: var(--ink); }
.mp-panel__count { color: var(--ink3); font-weight: 600; font-size: 0.92rem; }
.mp-panel__toggle { display: none; }
.mp-panel__body { flex: 1 1 auto; min-height: 0; overflow: auto; padding: 4px 12px 18px; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--line2) transparent; }
.mp-list { display: flex; flex-direction: column; }
.mp-cat { margin-top: 16px; display: flex; flex-direction: column; }
.mp-cat__t { padding: 0 12px 6px; }
.mp-row { width: 100%; display: flex; align-items: center; gap: 12px; min-height: 62px; padding: 8px 10px 8px 12px; border: 0; border-radius: 14px; background: none; color: var(--ink); text-align: left; font-family: var(--font); transition: background-color 0.15s ease; }
.mp-row:hover, .mp-row:focus-visible { background: var(--panel2); }
.mp .isq { --tc: var(--tl, var(--primary-l)); --ti: var(--tk, var(--primary)); }
.mp.is-dark .isq { --tc: var(--td, var(--primary-l)); --ti: var(--tb, #e3eeee); }
.mp-row__txt { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.mp-row__t { font-weight: 700; font-size: 1rem; line-height: 1.25; }
.mp-row__who { font-weight: 600; color: var(--ink2); }
.mp-row__rec { display: inline-grid; vertical-align: -0.12em; margin-left: 6px; color: var(--gold); }
.mp-row__rec .ico { width: 0.9em; height: 0.9em; }
.mp-row__s { font-size: 0.9rem; color: var(--ink2); line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mp-row__go { flex: none; color: var(--ink3); display: grid; }
.mp-row__go .ico { width: 18px; height: 18px; }
.mp-row--me { margin-top: 4px; background: var(--gold-ll); }
.mp.is-dark .mp-row--me { background: rgba(201, 163, 90, 0.1); }
.mp-row--me:hover { background: var(--gold-l); }
.mp-row__me { flex: none; width: 40px; height: 40px; border-radius: 50%; overflow: hidden; display: grid; place-items: center; background: var(--panel3); box-shadow: 0 0 0 2.5px var(--gold); color: var(--gold-d); }
.mp-row__me .ava { width: 100%; height: 100%; border: 0; box-shadow: none; }
.mp-key { margin: 18px 0 4px; }
.mp-key__row { display: flex; flex-wrap: wrap; gap: 8px 14px; padding: 0 12px; }
.mp-key__i { display: inline-flex; align-items: center; gap: 7px; font-size: 0.88rem; font-weight: 600; color: var(--ink2); }
.mp-key__i i { width: 18px; height: 12px; border-radius: 4px; box-shadow: inset 0 0 0 1px rgba(16, 22, 28, 0.08); }
.mp-key__i i.k-water { background: var(--m-water); } .mp-key__i i.k-green { background: var(--m-park); } .mp-key__i i.k-major { background: var(--m-major); box-shadow: inset 0 0 0 1.5px var(--m-major-edge); }
.mp-key__i i.k-house { background: var(--m-house); } .mp-key__i i.k-plaza { background: var(--m-plaza); box-shadow: inset 0 0 0 1.5px var(--m-plaza-edge); }

/* the place card (inside the panel / the sheet) */
.mp-card { padding: 2px 10px 6px; animation: mpCardIn 0.26s var(--ease); } /* (motion only: the card is never hidden by a slow first frame) */
.mp-card__bar { display: flex; align-items: center; justify-content: space-between; margin: 0 -4px 6px; }
.mp-card__back { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px 0 8px; border: 0; border-radius: 12px; background: none; color: var(--ink2); font-family: var(--font); font-weight: 700; font-size: 0.98rem; }
.mp-card__back:hover { background: var(--panel2); color: var(--ink); }
.mp-card__back .ico { width: 18px; height: 18px; }
.mp-card__x { display: none; width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--panel2); color: var(--ink2); place-items: center; }
.mp-card__x .ico { width: 20px; height: 20px; }
.mp-card__head { display: flex; align-items: center; gap: 16px; }
.mp-card__ava, .mp-card__meava { flex: none; width: 92px; height: 92px; border-radius: 50%; overflow: hidden; border: 3px solid var(--panel); box-shadow: 0 0 0 1px var(--hair), 0 8px 22px rgba(16, 22, 28, 0.16); display: grid; place-items: center; background: var(--panel3); }
.mp-card__meava { box-shadow: 0 0 0 3px var(--gold), 0 8px 22px rgba(16, 22, 28, 0.16); }
.mp-card__meava .ava { width: 100%; height: 100%; border: 0; box-shadow: none; }
.mp-card__isq { width: 72px; height: 72px; border-radius: 20px; } .mp-card__isq .ico { width: 34px; height: 34px; }
.mp-card__mark { width: 72px; height: 72px; }
.mp-card__ttl { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.mp-card__name { font: 700 1.6rem/1.15 var(--display); color: var(--ink); }
.mp-card__who { color: var(--ink2); font-weight: 600; font-size: 0.98rem; line-height: 1.35; }
.mp-card__chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
.mp-card__chips .tag { font-size: 0.84rem; padding: 4px 9px; }
.mp-card__about { margin-top: 12px; font-size: 1.04rem; line-height: 1.55; color: var(--ink); }
.mp-card__now { margin-top: 8px; font-size: 0.96rem; line-height: 1.45; color: var(--ink); }
.mp-card__acts { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.mp-card__acts .btn { flex: 1 1 auto; }
.mp.is-dark .btn.ghost { --c: var(--panel2); --cd: var(--panel3); border-color: var(--line2); }

/* ---------------------------------------------------------------- controls, the scale bar, the compass */
.mp-ctrl { position: absolute; z-index: 6; right: calc(16px + env(safe-area-inset-right, 0px)); bottom: calc(24px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: 8px; }
.mp-cbtn { width: 50px; height: 50px; padding: 0; border-radius: 15px; display: grid; place-items: center; color: var(--ink); transition: background-color 0.15s ease; }
.mp-cbtn:hover { background: var(--panel); }
.mp-cbtn .ico { width: 22px; height: 22px; }
.mp-scale { position: absolute; z-index: 5; left: calc(16px + 380px + 20px + env(safe-area-inset-left, 0px)); bottom: calc(22px + env(safe-area-inset-bottom, 0px)); display: flex; align-items: center; gap: 10px; pointer-events: none; }
.mp-compass { position: relative; width: 46px; height: 46px; border-radius: 50%; display: block; }
.mp-compass i { position: absolute; left: 50%; top: 50%; width: 8px; height: 28px; margin: -14px 0 0 -4px; transform: rotate(45deg); clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); background: linear-gradient(to bottom, var(--danger) 0 50%, var(--ink3) 50% 100%); }
.mp-compass__n { position: absolute; left: 50%; top: 50%; width: 16px; height: 16px; margin: -8px 0 0 -8px; transform: rotate(45deg) translateY(-15px) rotate(-45deg); display: grid; place-items: center; font-size: 0.76rem; font-weight: 800; color: var(--danger); }
.mp-compass i { opacity: 0.9; }
.mp-scale__bar { display: flex; flex-direction: column; gap: 3px; padding: 7px 12px 6px; border-radius: 12px; font-size: 0.8rem; font-weight: 700; color: var(--ink2); }
.mp-scale__bar i { display: block; height: 6px; min-width: 40px; border: 2px solid var(--ink2); border-top: 0; transition: width 0.15s ease; }

@keyframes mpCardIn { from { transform: translateY(8px); } }
@keyframes mpPop { from { opacity: 0; transform: translateY(8px) scale(0.6); } 60% { opacity: 1; } to { opacity: 1; transform: none; } }
@keyframes mpPulse { from { transform: scale(1); opacity: 0.85; } to { transform: scale(2.9); opacity: 0; } }
@keyframes mpHalo { from { transform: scale(1); opacity: 0.9; } to { transform: scale(1.75); opacity: 0; } }
@keyframes mpRing { from { transform: scale(0.6); opacity: 0.55; } to { transform: scale(2.4); opacity: 0; } }

/* big font (seniors): a wider panel, bigger pins */
html.big .mp-panel { width: 420px; }
html.big .mp-scale { left: calc(16px + 420px + 20px); }
html.big .mp-pin { width: 44px; height: 44px; margin: -56px 0 0 -22px; }
html.big .mp-pin::before { top: 36px; }
html.big .mp-pin__lbl { top: 60px; }

/* ---------------------------------------------------------------- phones: a bottom sheet (peek → list → card) */
@media (max-width: 760px) {
  .mp-top { left: calc(12px + env(safe-area-inset-left, 0px)); right: calc(12px + env(safe-area-inset-right, 0px)); top: calc(12px + env(safe-area-inset-top, 0px)); justify-content: space-between; }
  .mp-top__title { display: inline-flex; align-items: center; gap: 9px; height: 50px; padding: 0 18px 0 14px; border-radius: 15px; font-weight: 700; font-size: 1.05rem; color: var(--ink); }
  .mp-top__title .ico { width: 20px; height: 20px; color: var(--primary); }
  .mp.is-dark .mp-top__title .ico { color: var(--gold); }
  .mp-close { width: 50px; padding: 0; justify-content: center; }
  .mp-close__l { display: none; }
  .mp-panel { left: 0; right: 0; top: auto; bottom: 0; width: auto; max-height: calc(100% - 84px - env(safe-area-inset-top, 0px)); border-radius: 22px 22px 0 0; border-width: 1px 0 0;
    padding-bottom: env(safe-area-inset-bottom, 0px); transform: translateY(24px); box-shadow: 0 -12px 40px rgba(10, 14, 20, 0.22); }
  .mp[data-sheet="list"] .mp-panel { height: 64%; }
  .mp-grip { display: grid; place-items: center; flex: none; width: 100%; height: 26px; padding: 0; border: 0; background: none; }
  .mp-grip i { width: 42px; height: 5px; border-radius: 5px; background: var(--line2); }
  .mp-panel__head { padding: 0 16px 14px 20px; align-items: center; }
  .mp-panel__ttl h2 { font-size: 1.35rem; }
  .mp-panel__toggle { display: inline-flex; align-items: center; gap: 6px; flex: none; min-height: 44px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line2); background: var(--panel); color: var(--ink); font-family: var(--font); font-weight: 700; font-size: 0.95rem; }
  .mp-panel__toggle .ico { width: 18px; height: 18px; transition: transform 0.2s ease; }
  .mp[data-sheet="list"] .mp-panel__toggle .ico { transform: rotate(180deg); }
  .mp[data-sheet="peek"] .mp-panel__body { display: none; }
  .mp[data-sheet="card"] .mp-panel__head { display: none; }
  .mp-panel__body { padding: 0 8px 14px; }
  .mp[data-sheet="card"] .mp-panel__body { padding-top: 0; }
  .mp-card { padding: 0 8px 4px; }
  .mp-card__x { display: grid; }
  .mp-card__ava, .mp-card__meava { width: 76px; height: 76px; }
  .mp-card__isq, .mp-card__mark { width: 64px; height: 64px; }
  .mp-card__name { font-size: 1.4rem; }
  .mp-card__chips { margin-top: 12px; }
  .mp-card__about { font-size: 1rem; margin-top: 10px; }
  .mp-card__acts { margin-top: 14px; }
  .mp-card__acts .btn { flex: 1 1 100%; }
  .mp-ctrl { top: calc(74px + env(safe-area-inset-top, 0px)); bottom: auto; right: calc(12px + env(safe-area-inset-right, 0px)); }
  .mp-ctrl .mp-cbtn:nth-child(-n+2) { display: none; } /* pinch zooms on phones; «где я» and «весь город» stay */
  .mp-cbtn { width: 48px; height: 48px; }
  .mp-scale { left: calc(12px + env(safe-area-inset-left, 0px)); top: calc(74px + env(safe-area-inset-top, 0px)); bottom: auto; }
  .mp-compass { width: 42px; height: 42px; }
  .mp-pin { width: 38px; height: 38px; margin: -50px 0 0 -19px; }
  .mp-pin::before { top: 30px; }
  .mp-pin__lbl { top: 54px; }
  html.big .mp-panel { width: auto; }
  html.big .mp-scale { left: calc(12px + env(safe-area-inset-left, 0px)); }
}
@media (max-width: 380px) {
  .mp-top__title { padding: 0 14px 0 12px; font-size: 1rem; }
  .mp-panel__toggle > span:not(.ico) { display: none; }
  .mp-panel__toggle { width: 48px; padding: 0; justify-content: center; }
  .mp-scale__bar { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .mp-me__pulse, .mp-pin.is-sel::after, .mp-pin.has-me .mp-pin__head::before { animation: none; opacity: 0; }
}
html.lowfx .mp-close, html.lowfx .mp-top__title, html.lowfx .mp-cbtn, html.lowfx .mp-scale__bar, html.lowfx .mp-compass { background: var(--panel); }
/* v7.5 «Скоро открытие»: a studio under construction — a small hazard badge on its pin (the list and the card say «Скоро») */
.mp-pin__soon { position: absolute; right: -7px; top: -7px; z-index: 2; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: #e2b33c; color: #2b2208; box-shadow: 0 0 0 2px #fff, 0 2px 5px rgba(16, 22, 28, 0.3); pointer-events: none; }
.mp-pin__soon .ico { width: 12px; height: 12px; }
.mp-pin.is-soon .mp-pin__head { filter: saturate(0.75); }
.mp-pin.is-cluster .mp-pin__soon { display: none; }
.mp-row .tag.soon-tag { margin-left: 8px; }
.mp-card__chips .tag.soon-tag { margin-left: 0; font-size: 0.8rem; }
