/* Phone layout of the map tools (map-compact.js): short rail + «⋯» menu with captions. */
body.mc-phone .leaflet-control-zoom,
body.mc-phone .hm-ctl,
body.mc-phone .mc-empty,
body.mc-phone .mc-gone { display: none !important; }

body.mc-phone .leaflet-top.leaflet-right > .leaflet-control { margin-top: 6px !important; }
body.mc-phone .leaflet-top.leaflet-right > .leaflet-control:first-child { margin-top: 8px !important; }

.mc-ctl { position: relative; margin: 6px 8px 0 0 !important; border-radius: 12px !important; overflow: visible !important;
  background: var(--panel); border: 1px solid var(--line) !important; box-shadow: var(--shadow);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); }
.mc-more { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; padding: 0; border: 0;
  border-radius: 12px; background: transparent; color: var(--text); cursor: pointer; }
.mc-more svg { width: 20px; height: 20px; fill: currentColor; stroke: none; }
.mc-more[aria-expanded="true"] { background: var(--surface-hover); color: #ff7a3d; }

.mc-menu { position: absolute; top: 0; right: calc(100% + 8px); min-width: 210px; padding: 6px; border-radius: 14px;
  background: var(--panel-solid); border: 1px solid var(--line-2); box-shadow: var(--shadow);
  animation: mc-in .18s ease-out both; transform-origin: top right; }
.mc-menu[hidden] { display: none; }
@keyframes mc-in { from { opacity: 0; transform: scale(.96) translateX(6px); } to { opacity: 1; transform: none; } }
.mc-row { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 10px 0 2px; border-radius: 10px; cursor: pointer; }
.mc-row:hover, .mc-row:active { background: var(--surface-hover); }
.mc-row > a, .mc-row > button { flex: none; display: flex !important; align-items: center; justify-content: center;
  width: 40px !important; height: 40px !important; margin: 0 !important; border: 0 !important; border-radius: 10px !important;
  background: transparent !important; color: var(--text) !important; box-shadow: none !important; }
.mc-row > span { color: var(--text); font-size: 13.5px; font-weight: 500; line-height: 1.25; }

/* Phone header: the buttons on the right (theme, VPN, «Игра») did not fit and «Игра» was cut off;
   now the row scrolls sideways instead of overflowing the screen. */
@media (max-width: 760px) {
  .topbar { min-width: 0; }
  .topbar .top-actions { min-width: 0; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none;
    -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 18px), transparent);
            mask-image: linear-gradient(90deg, #000 calc(100% - 18px), transparent); }
  .topbar .top-actions::-webkit-scrollbar { display: none; }
  .topbar .top-actions > * { flex: none; }
}

@media (prefers-reduced-motion: reduce) { .mc-menu { animation: none; } }

/* chips row (Фиксации · Тепловая карта · Вся карта) ends before the tool rail on the right */
@media (max-width: 760px) {
  body.mc-phone .mobile-map-actions { right: calc(var(--gap) + 54px); }
}
