@media (max-width: 850px) {
  html,
  body {
    height: 100%;
    overflow: hidden;
  }

  #mobileBottomNav {
position: fixed !important;
left: 0 !important;
right: 0 !important;
bottom: 0 !important;
height: 58px !important;
z-index: 99997 !important;
display: flex !important;
background: white !important;
border-top: 1px solid #ddd !important;
box-shadow: 0 -3px 12px rgba(0,0,0,.25) !important;
}

#mobileBottomNav button {
flex: 1;
border: none;
border-radius: 0;
background: white;
font-size: 13px;
font-weight: bold;
}

#mobileFab {
bottom: 76px !important;
top: auto !important;
}

  #app {
    display: block;
    height: 100%;
  }

  #map {
    position: fixed;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    height: 100%;
    width: 100%;
    z-index: 1;
  }

  #panel {
    position: fixed;
    left: 10px;
    right: 10px;
    top: 10px;
    width: auto;
    min-width: 0;
    height: auto;
    max-height: 145px;
    border-radius: 16px;
    z-index: 2000;
    overflow: hidden;
    box-shadow: 0 3px 18px rgba(0, 0, 0, 0.30);
  }

  #panelTop {
    padding: 12px;
    max-height: 145px;
    overflow: hidden;
  }

  #title {
    font-size: 20px;
    margin-bottom: 2px;
  }

  #stats {
    font-size: 13px;
    margin-bottom: 8px;
  }

  #search {
    font-size: 15px;
    padding: 9px;
    margin: 6px 0 0 0;
    border-radius: 10px;
  }

  #panelTop .buttons,
  .toolLine,
  #coords,
  #traccarStatus,
  #trackStats,
  #messagesStatus,
  #mapUserStatus,
  #adminPanel,
  #list,
  #showPanelBtn {
  display: none !important;
  }

  body.panel-hidden #panel {
    display: none;
  }

  #mapObjectDialog > div {
    width: 96% !important;
    max-height: 92vh !important;
    border-radius: 14px !important;
  }

  #hideAllBtn {
    display: none !important;
  }

  #mobileFab {
    position: fixed !important;
    right: 12px !important;
    top: 175px !important;
    z-index: 99998 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
    pointer-events: auto !important;
  }

  #mobileFab button {
    width: 52px;
    height: 52px;
    border: none;
    border-radius: 50%;
    background: white;
    color: #1d2b3a;
    font-size: 20px;
    font-weight: bold;
    box-shadow: 0 3px 12px rgba(0,0,0,.35);
  }

  #mobileFab button:nth-child(1),
  #mobileFab button:nth-child(2) {
    background: #1976d2;
    color: white;
  }

  #mobileFab button:nth-child(2) {
    font-size: 30px;
  }
}

@media (min-width: 851px) {
  #mobileBottomNav,
  #hideAllBtn,
  #mobileFab {
    display: none !important;
  }
}

@media (max-width: 850px) {
#mobileBottomNav {
position: fixed !important;
left: 0 !important;
right: 0 !important;
bottom: 0 !important;
height: 58px !important;
z-index: 99997 !important;
display: flex !important;
background: white !important;
border-top: 1px solid #ddd !important;
box-shadow: 0 -3px 12px rgba(0,0,0,.25) !important;
}

#mobileBottomNav button {
flex: 1 !important;
display: block !important;
border: none !important;
border-radius: 0 !important;
background: white !important;
font-size: 13px !important;
font-weight: bold !important;
}

#mobileFab {
bottom: 76px !important;
top: auto !important;
}
}

@media (max-width: 850px) {
#mobileMenuOverlay {
position: fixed;
left: 0;
top: 0;
right: 0;
bottom: 0;
z-index: 5999;
background: rgba(0,0,0,.28);
backdrop-filter: blur(2px);
}

#mobileMenuSheet {
position: fixed;
left: 0;
right: 0;
bottom: 58px;
z-index: 6000;
background: #fff;
border-radius: 22px 22px 0 0;
box-shadow: 0 -8px 28px rgba(0,0,0,.28);
padding: 10px 14px 16px 14px;
max-height: 62vh;
overflow: auto;
}

#mobileMenuHandle {
width: 48px;
height: 5px;
border-radius: 99px;
background: #d0d4dc;
margin: 0 auto 10px auto;
}

.mobileMenuHeader {
display: grid;
grid-template-columns: 44px 1fr 44px;
align-items: center;
margin-bottom: 12px;
}

.mobileMenuHeader b {
text-align: center;
font-size: 20px;
}

.mobileMenuHeaderBtn {
width: 40px;
height: 40px;
border: none;
border-radius: 12px;
background: #f5f6f8;
font-size: 26px;
line-height: 1;
}

.mobileMenuGrid {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 10px;
}

.mobileMenuCard {
min-height: 112px;
border: 1px solid #e4e7ee;
border-radius: 18px;
background: #fff;
box-shadow: 0 4px 14px rgba(0,0,0,.08);
padding: 13px;
text-align: left;
display: grid;
grid-template-columns: 44px 1fr 18px;
gap: 9px;
align-items: center;
}

.mobileMenuIcon {
width: 42px;
height: 42px;
border-radius: 50%;
background: #1976d2;
color: #fff;
display: flex;
align-items: center;
justify-content: center;
font-size: 23px;
font-weight: bold;
}

.mobileMenuCard:nth-child(2) .mobileMenuIcon {
background: #43a047;
}

.mobileMenuCard:nth-child(3) .mobileMenuIcon {
background: #6f42c1;
}

.mobileMenuCard:nth-child(4) .mobileMenuIcon {
background: #f0a000;
}

.mobileMenuText b {
display: block;
color: #172033;
font-size: 16px;
margin-bottom: 5px;
}

.mobileMenuText small {
display: block;
color: #526070;
font-size: 13px;
line-height: 1.25;
}

.mobileMenuArrow {
color: #172033;
font-size: 28px;
line-height: 1;
}

.mobileMenuRows {
border: 1px solid #e6e9ef;
border-radius: 16px;
overflow: hidden;
background: #fff;
}

.mobileMenuRow {
width: 100%;
border: none;
border-bottom: 1px solid #edf0f5;
border-radius: 0;
background: #fff;
padding: 13px 10px;
display: grid;
grid-template-columns: 42px 1fr 20px;
align-items: center;
text-align: left;
}

.mobileMenuRow:last-child {
border-bottom: none;
}

.mobileMenuRowIcon {
color: #1976d2;
font-size: 24px;
font-weight: bold;
text-align: center;
}

.mobileMenuRowTitle {
color: #172033;
font-size: 15px;
font-weight: 600;
}

#mobileBottomNav {
height: 64px !important;
}

#mobileBottomNav button {
font-size: 14px !important;
color: #172033 !important;
}
}

@media (max-width: 850px) {
  #mobileMenuOverlay {
    position: fixed !important;
    left: 0 !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    z-index: 5999 !important;
    background: rgba(0,0,0,.28) !important;
    backdrop-filter: blur(2px);
  }

  #mobileMenuSheet {
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 64px !important;
    z-index: 6000 !important;
    background: #ffffff !important;
    border-radius: 22px 22px 0 0 !important;
    box-shadow: 0 -10px 30px rgba(0,0,0,.28) !important;
    padding: 10px 14px 16px 14px !important;
    max-height: 62vh !important;
    overflow: auto !important;
  }

  #mobileMenuHandle {
    width: 46px !important;
    height: 5px !important;
    border-radius: 99px !important;
    background: #d1d5db !important;
    margin: 0 auto 10px auto !important;
  }

  .mobileMenuHeader {
    display: grid !important;
    grid-template-columns: 44px 1fr 44px !important;
    align-items: center !important;
    margin-bottom: 12px !important;
  }

  .mobileMenuTitle {
    text-align: center !important;
    font-size: 21px !important;
    font-weight: 800 !important;
    color: #111827 !important;
  }

  .mobileMenuHeaderBtn {
    width: 40px !important;
    height: 40px !important;
    border: none !important;
    border-radius: 14px !important;
    background: #f3f4f6 !important;
    color: #111827 !important;
    font-size: 28px !important;
    line-height: 1 !important;
  }

  .mobileMenuGrid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
  }

  .mobileMenuCard {
    min-height: 118px !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 18px !important;
    background: #ffffff !important;
    box-shadow: 0 5px 16px rgba(0,0,0,.08) !important;
    padding: 13px !important;
    text-align: left !important;
    display: grid !important;
    grid-template-columns: 44px 1fr 18px !important;
    gap: 10px !important;
    align-items: center !important;
  }

  .mobileMenuIcon {
    width: 42px !important;
    height: 42px !important;
    border-radius: 50% !important;
    color: white !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 23px !important;
    font-weight: 800 !important;
    background: #1976d2 !important;
  }

  .mobileMenuIcon-objects {
    background: #43a047 !important;
  }

  .mobileMenuIcon-gps {
    background: #6f42c1 !important;
  }

  .mobileMenuIcon-more {
    background: #f0a000 !important;
  }

  .mobileMenuText b {
    display: block !important;
    color: #111827 !important;
    font-size: 16px !important;
    margin-bottom: 5px !important;
  }

  .mobileMenuText small {
    display: block !important;
    color: #4b5563 !important;
    font-size: 13px !important;
    line-height: 1.25 !important;
  }

  .mobileMenuArrow {
    color: #111827 !important;
    font-size: 28px !important;
    line-height: 1 !important;
  }

  .mobileMenuRows {
    border: 1px solid #e5e7eb !important;
    border-radius: 18px !important;
    overflow: hidden !important;
    background: #ffffff !important;
  }

  .mobileMenuRow {
    width: 100% !important;
    border: none !important;
    border-bottom: 1px solid #edf0f5 !important;
    border-radius: 0 !important;
    background: #ffffff !important;
    padding: 14px 10px !important;
    display: grid !important;
    grid-template-columns: 42px 1fr 20px !important;
    align-items: center !important;
    text-align: left !important;
  }

  .mobileMenuRow:last-child {
    border-bottom: none !important;
  }

  .mobileMenuRowIcon {
    color: #1976d2 !important;
    font-size: 24px !important;
    font-weight: 800 !important;
    text-align: center !important;
  }

  .mobileMenuRowTitle {
    color: #111827 !important;
    font-size: 15px !important;
    font-weight: 700 !important;
  }

  #mobileBottomNav {
    height: 64px !important;
    display: flex !important;
    background: #ffffff !important;
    border-top: 1px solid #e5e7eb !important;
    box-shadow: 0 -4px 18px rgba(0,0,0,.14) !important;
  }

  #mobileBottomNav button {
    flex: 1 !important;
    border: none !important;
    border-radius: 0 !important;
    background: #ffffff !important;
    color: #111827 !important;
    font-size: 14px !important;
    font-weight: 800 !important;
  }

  #mobileBottomNav button:active {
    background: #f3f4f6 !important;
  }
}

@media (max-width: 850px) {
  #mobileBottomNav {
    bottom: env(safe-area-inset-bottom) !important;
    padding-bottom: env(safe-area-inset-bottom) !important;
    height: 64px !important;
  }

  #mobileMenuSheet {
    bottom: calc(64px + env(safe-area-inset-bottom)) !important;
    max-height: calc(72vh - env(safe-area-inset-bottom)) !important;
  }

  #mobileFab {
    bottom: calc(88px + env(safe-area-inset-bottom)) !important;
    top: auto !important;
  }

  #mapObjectDialog > div {
    max-height: calc(92vh - 80px) !important;
    margin-bottom: 76px !important;
  }
}

@media (max-width: 850px) {
#mobileBottomNav {
bottom: env(safe-area-inset-bottom) !important;
padding-bottom: env(safe-area-inset-bottom) !important;
height: 64px !important;
}

#mobileMenuSheet {
bottom: calc(64px + env(safe-area-inset-bottom)) !important;
max-height: calc(72vh - env(safe-area-inset-bottom)) !important;
}

#mobileFab {
bottom: calc(88px + env(safe-area-inset-bottom)) !important;
top: auto !important;
}

#mapObjectDialog > div {
max-height: calc(92vh - 80px) !important;
margin-bottom: 76px !important;
}

.mobileLayerSearch {
width: 100% !important;
box-sizing: border-box !important;
padding: 11px !important;
border: 1px solid #d1d5db !important;
border-radius: 14px !important;
font-size: 15px !important;
margin-bottom: 10px !important;
}

.mobileLayerTools {
display: grid !important;
grid-template-columns: 1fr 1fr 1fr !important;
gap: 8px !important;
margin-bottom: 10px !important;
}

.mobileLayerTools button {
padding: 10px 6px !important;
border: 1px solid #d1d5db !important;
border-radius: 12px !important;
background: #f9fafb !important;
font-weight: 700 !important;
font-size: 13px !important;
}

.mobileLayerGroup {
margin: 10px 0 6px 0 !important;
padding: 8px 10px !important;
border-radius: 12px !important;
background: #eef4ff !important;
font-weight: 800 !important;
color: #1f2937 !important;
}

.mobileLayerRow {
width: 100% !important;
display: grid !important;
grid-template-columns: 34px 34px 1fr !important;
gap: 8px !important;
align-items: center !important;
padding: 10px 8px !important;
border: 1px solid #edf0f5 !important;
border-radius: 14px !important;
background: #ffffff !important;
margin-bottom: 6px !important;
text-align: left !important;
}

.mobileLayerRow input {
width: 22px !important;
height: 22px !important;
}

.mobileLayerStar {
font-size: 24px !important;
color: #9ca3af !important;
text-align: center !important;
}

.mobileLayerStar.on {
color: #f0a000 !important;
}

.mobileLayerName {
font-weight: 800 !important;
font-size: 15px !important;
color: #111827 !important;
}

.mobileLayerMeta {
font-size: 12px !important;
color: #6b7280 !important;
margin-top: 2px !important;
}
}

@media (max-width: 850px) {
  #panel {
    display: none !important;
  }

  #map {
    top: 0 !important;
    bottom: calc(64px + env(safe-area-inset-bottom)) !important;
  }

  .mobileLocked {
    padding: 18px !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 18px !important;
    background: #fff7db !important;
    color: #5c4300 !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    line-height: 1.35 !important;
  }

  .mobileLocked button {
    margin-top: 14px !important;
    width: 100% !important;
    padding: 12px !important;
    border: none !important;
    border-radius: 14px !important;
    background: #1976d2 !important;
    color: white !important;
    font-size: 16px !important;
    font-weight: 800 !important;
  }
}

@media (max-width: 850px) {
#mobileFab {
display: none !important;
}

#mapObjectsListDialog > div {
max-height: calc(100vh - 92px - env(safe-area-inset-bottom)) !important;
margin-bottom: calc(76px + env(safe-area-inset-bottom)) !important;
}

#mapObjectsListDialog table {
margin-bottom: 90px !important;
}

#mapObjectsListDialog {
align-items: flex-start !important;
padding-top: 12px !important;
box-sizing: border-box !important;
}

#mobileBottomNav {
z-index: 99999 !important;
}
}

@media (max-width: 850px) {
body.mobileChromeHidden #mobileBottomNav {
display: none !important;
}

body.mobileChromeHidden #map {
bottom: 0 !important;
}

body.mobileChromeHidden #mobileMenuSheet,
body.mobileChromeHidden #mobileMenuOverlay {
display: none !important;
}

body.mobileChromeHidden::after {
content: "☰";
position: fixed;
right: 16px;
bottom: calc(18px + env(safe-area-inset-bottom));
width: 58px;
height: 58px;
border-radius: 50%;
background: #1976d2;
color: white;
z-index: 100000;
display: flex;
align-items: center;
justify-content: center;
font-size: 30px;
font-weight: 800;
box-shadow: 0 4px 16px rgba(0,0,0,.35);
pointer-events: none;
}
}

@media (max-width: 850px) {
  #mobileMapModeBtn {
    position: fixed !important;
    right: 16px !important;
    bottom: calc(82px + env(safe-area-inset-bottom)) !important;
    width: 58px !important;
    height: 58px !important;
    border-radius: 50% !important;
    border: none !important;
    background: #1976d2 !important;
    color: white !important;
    z-index: 100000 !important;
    font-size: 30px !important;
    font-weight: 800 !important;
    box-shadow: 0 4px 16px rgba(0,0,0,.35) !important;
  }

  body.mobileChromeHidden #mobileBottomNav {
    display: none !important;
  }

  body.mobileChromeHidden #map {
    bottom: 0 !important;
  }

  body.mobileChromeHidden #mobileMapModeBtn {
    bottom: calc(18px + env(safe-area-inset-bottom)) !important;
    background: #1976d2 !important;
  }
}

@media (max-width: 850px) {
#panel {
display: none !important;
}

#mobileFab {
display: none !important;
}

#map {
top: 0 !important;
bottom: calc(64px + env(safe-area-inset-bottom)) !important;
}

body.mobileChromeHidden #mobileBottomNav {
display: none !important;
}

body.mobileChromeHidden #map {
bottom: 0 !important;
}

body.mobileChromeHidden #mobileMapModeBtn {
bottom: calc(18px + env(safe-area-inset-bottom)) !important;
}

#mobileMapModeBtn {
position: fixed !important;
right: 16px !important;
bottom: calc(82px + env(safe-area-inset-bottom)) !important;
width: 58px !important;
height: 58px !important;
border-radius: 50% !important;
border: none !important;
background: #1976d2 !important;
color: white !important;
z-index: 100000 !important;
font-size: 30px !important;
font-weight: 800 !important;
box-shadow: 0 4px 16px rgba(0,0,0,.35) !important;
}

#mapObjectsListDialog {
align-items: flex-start !important;
padding-top: 12px !important;
box-sizing: border-box !important;
}

#mapObjectsListDialog > div {
max-height: calc(100vh - 92px - env(safe-area-inset-bottom)) !important;
margin-bottom: calc(76px + env(safe-area-inset-bottom)) !important;
}

#mapObjectsListDialog table {
margin-bottom: 90px !important;
}

#mapObjectDialog > div {
max-height: calc(92vh - 90px) !important;
margin-bottom: 76px !important;
}
}

#mapObjectsListDialog {
  position: fixed;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 12000;
  background: rgba(0,0,0,.45);
  display: flex;
  align-items: center;
  justify-content: center;
}

.mapObjectsListBox {
  width: 920px;
  max-width: 96vw;
  max-height: 88vh;
  background: white;
  border-radius: 14px;
  box-shadow: 0 10px 35px rgba(0,0,0,.35);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.mapObjectsListHeader {
  padding: 12px 14px;
  border-bottom: 1px solid #ddd;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.mapObjectsListHeader b {
  font-size: 20px;
}

.mapObjectsListHeader span {
  font-size: 12px;
  color: #666;
}

.mapObjectsListSearchWrap {
  padding: 10px 14px;
  border-bottom: 1px solid #eee;
}

.mapObjectsListSearchWrap input {
  width: 100%;
  box-sizing: border-box;
  padding: 9px;
  border: 1px solid #ccc;
  border-radius: 9px;
  font-size: 14px;
}

.mapObjectsListBody {
  overflow: auto;
  padding: 10px;
}

@media (max-width: 850px) {
  #mapObjectsListDialog {
    align-items: flex-start !important;
    padding: 10px 8px calc(76px + env(safe-area-inset-bottom)) 8px !important;
    box-sizing: border-box !important;
  }

  .mapObjectsListBox {
    width: 100% !important;
    max-width: 100% !important;
    max-height: calc(100vh - 88px - env(safe-area-inset-bottom)) !important;
    border-radius: 18px !important;
  }

  .mapObjectsListHeader {
    padding: 12px !important;
  }

  .mapObjectsListHeader b {
    font-size: 19px !important;
  }

  .mapObjectsListSearchWrap {
    padding: 10px 12px !important;
  }

  .mapObjectsListBody {
    padding: 10px 10px calc(92px + env(safe-area-inset-bottom)) 10px !important;
  }

  .mobileObjectCards {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-bottom: 90px;
  }

  .mobileObjectCard {
    display: grid;
    grid-template-columns: 86px 1fr;
    gap: 10px;
    min-height: 104px;
    padding: 10px;
    border-left: 6px solid #777;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 3px 12px rgba(0,0,0,.10);
  }

  .mobileObjectPhoto {
    width: 86px;
    height: 86px;
    border-radius: 14px;
    background: #eef1f5;
    color: #7b8491;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
  }

  .mobileObjectPhoto img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .mobileObjectPhotoBadge {
    position: absolute;
    right: 5px;
    bottom: 5px;
    min-width: 22px;
    height: 22px;
    border-radius: 999px;
    background: rgba(0,0,0,.70);
    color: white;
    font-size: 12px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .mobileObjectMain {
    min-width: 0;
  }

  .mobileObjectType {
    font-weight: 900;
    font-size: 15px;
    margin-bottom: 4px;
  }

  .mobileObjectText {
    font-size: 14px;
    color: #111827;
    line-height: 1.25;
    margin-bottom: 6px;
  }

  .mobileObjectMeta {
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 8px;
  }

  .mobileObjectActions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
  }

  .mobileObjectActions button {
    flex: 1;
    min-width: 92px;
  }
}

/* =======================================================
   Mobile object cards v2
   ======================================================= */

.mobileObjectCards {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 12px;
    padding-bottom: 120px;
}

.mobileObjectCard {
    display: flex;
    align-items: stretch;
    background: #fff;
    border-radius: 18px;
    overflow: hidden;
    border-left: 8px solid #1976d2;
    box-shadow: 0 6px 18px rgba(0,0,0,.12);
    transition: .18s;
}

.mobileObjectCard:active {
    transform: scale(.985);
}

.mobileObjectPhoto {
    width: 110px;
    min-width: 110px;
    height: 120px;
    background: #ececec;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    position: relative;
    overflow: hidden;
}

.mobileObjectPhoto img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mobileObjectPhotoBadge {
    position: absolute;
    right: 6px;
    top: 6px;
    background: rgba(0,0,0,.75);
    color: white;
    padding: 2px 7px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: bold;
}

.mobileObjectMain {
    flex: 1;
    padding: 12px;
    display: flex;
    flex-direction: column;
}

.mobileObjectType {
    font-size: 15px;
    font-weight: 700;
}

.mobileObjectText {
    margin-top: 8px;
    color: #333;
    line-height: 1.35;
    flex: 1;
}

.mobileObjectMeta {
    margin-top: 10px;
    font-size: 12px;
    color: #777;
}

.mobileObjectActions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.mobileObjectActions button {
    flex: 1;
    border: none;
    border-radius: 10px;
    background: #1976d2;
    color: white;
    padding: 10px;
    font-weight: 600;
}

.mobileObjectActions button:last-child {
    background: #616161;
}
