[hidden] { display: none !important; }

body { overflow: hidden; }
.app-shell { position: relative; height: 100dvh; min-height: 0; overflow: hidden; }
.app-shell > .map-toolbar { position: absolute; z-index: 5; top: max(12px, env(safe-area-inset-top)); left: 12px; display: flex; flex-direction: column; width: 48px; height: auto; padding: 0; gap: 8px; border: 0; background: transparent; }
.menu-toggle, .map-tool-button { height: 48px; background: rgba(255,255,255,.96); border: 1px solid var(--line); box-shadow: 0 8px 24px rgba(25,49,36,.16); backdrop-filter: blur(10px); }
.menu-toggle { display: grid; align-content: center; gap: 4px; width: 48px; padding: 0 13px; border-radius: 14px; }
.menu-toggle span { display: block; height: 2px; border-radius: 2px; background: var(--ink); }
.map-tool-button { display: grid; place-items: center; width: 48px; padding: 0; border-radius: 14px; color: var(--ink); }
.layers-icon { position: relative; display: block; width: 23px; height: 20px; }
.layers-icon i { position: absolute; left: 2px; width: 19px; height: 12px; border: 2px solid currentColor; border-radius: 3px; transform: rotate(45deg) skew(-8deg,-8deg); }
.layers-icon i:nth-child(1) { top: 0; }
.layers-icon i:nth-child(2) { top: 4px; background: rgba(255,255,255,.96); }
.layers-icon i:nth-child(3) { top: 8px; background: rgba(255,255,255,.96); }
.basemap-popover { position: absolute; z-index: 6; top: max(68px, calc(env(safe-area-inset-top) + 68px)); left: 72px; display: grid; min-width: 220px; padding: 14px; border: 1px solid var(--line); border-radius: 16px; background: rgba(255,255,255,.97); box-shadow: var(--shadow); backdrop-filter: blur(12px); }
.basemap-popover label { display: flex; align-items: center; gap: 9px; margin: 5px 0 0; padding: 7px 4px; font-size: 13px; }
.basemap-popover input { width: auto; margin: 0; accent-color: var(--green); }
.menu-backdrop { position: fixed; z-index: 19; inset: 0; padding: 0; border-radius: 0; background: rgba(10,20,15,.38); }
.app-menu { position: fixed; z-index: 20; inset: 0 auto 0 0; display: flex; flex-direction: column; width: min(380px, 92vw); padding-top: env(safe-area-inset-top); background: #fff; box-shadow: 18px 0 50px rgba(10,20,15,.22); overflow: hidden; }
.menu-heading { display: flex; align-items: center; justify-content: space-between; padding: 22px 20px 12px; }
.menu-heading h2 { margin: 3px 0 0; }
.menu-close { position: static; }
.drawer-nav { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 0 14px 16px; border-bottom: 1px solid var(--line); }
.drawer-nav .nav-button { min-height: 44px; padding: 8px; border-radius: 10px; background: #eef2ef; }
.drawer-nav .nav-button.active { color: #fff; background: var(--green); }
.drawer-nav .nav-button.active:after { display: none; }
.menu-devices { min-height: 0; flex: 1; overflow: auto; }
.menu-devices .sidebar-title { padding: 18px 20px 10px; }
.app-menu .device-list { padding: 0 12px 18px; }
.app-menu .account { margin: 0; padding: 12px 16px max(12px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); justify-content: space-between; }
.workspace { display: block; height: 100dvh; }
.map-panel { width: 100%; height: 100%; }
.page { height: 100dvh; max-width: none; padding: 84px 24px 32px; overflow: auto; }
.maplibregl-ctrl-top-right { top: max(12px, env(safe-area-inset-top)); }
.detail-card { bottom: max(16px, env(safe-area-inset-bottom)); }
.detail-heading { display: flex; align-items: center; gap: 10px; margin: 6px 38px 18px 0; }
.detail-heading h2 { min-width: 0; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.follow-button { display: grid; flex: 0 0 auto; place-items: center; width: 40px; height: 40px; padding: 0; border-radius: 50%; background: #eef2ef; color: var(--ink); }
.follow-button svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.follow-button.active { background: var(--green); color: #fff; }
.tracking-marker { position: relative; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 50%; background: transparent; overflow: visible; color: #fff; }
.marker-icon { display: grid; place-items: center; width: 36px; height: 36px; border: 3px solid #fff; border-radius: 50%; background: #59665f; box-shadow: 0 3px 12px rgba(15,25,20,.42); }
.marker-icon svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.marker-icon img { width: 24px; height: 24px; object-fit: contain; }
.marker-toyota .marker-icon, .marker-suzuki .marker-icon { background: #fff; }
.marker-trailer .marker-icon { background: #765636; }
.marker-phone .marker-icon { background: #176b49; }
.tracking-marker.selected .marker-icon { box-shadow: 0 0 0 3px var(--lime), 0 4px 15px rgba(15,25,20,.46); }
.tracking-marker.following .marker-icon { animation: follow-pulse 1.8s ease-out infinite; }
.marker-label { position: absolute; top: 40px; left: 50%; display: grid; justify-items: center; transform: translateX(-50%); color: var(--ink); white-space: nowrap; pointer-events: none; }
.marker-label strong, .marker-label small { padding: 2px 5px; border-radius: 5px; background: rgba(255,255,255,.92); box-shadow: 0 2px 7px rgba(20,35,27,.16); }
.marker-label strong { font-size: 9px; line-height: 1.2; letter-spacing: .08em; text-transform: uppercase; }
.marker-label small { margin-top: 2px; color: var(--green); font-size: 9px; font-weight: 850; }
@keyframes follow-pulse { 0% { box-shadow: 0 0 0 0 rgba(201,244,107,.8), 0 4px 15px rgba(15,25,20,.46); } 70% { box-shadow: 0 0 0 10px rgba(201,244,107,0), 0 4px 15px rgba(15,25,20,.46); } 100% { box-shadow: 0 0 0 0 rgba(201,244,107,0), 0 4px 15px rgba(15,25,20,.46); } }

@media (max-width: 760px) {
  .app-shell > .map-toolbar { padding: 0; }
  .basemap-popover { left: 68px; min-width: 210px; }
  .drawer-nav { grid-template-columns: 1fr; }
  .drawer-nav .nav-button { text-align: left; }
  .app-menu .device-list { display: grid; overflow: visible; }
  .app-menu .device { min-width: 0; }
  .detail-card { left: 10px; width: calc(100% - 20px); max-height: 54dvh; padding: 16px; overflow: auto; }
  .detail-card.following { width: auto; max-width: calc(100% - 20px); padding-bottom: 13px; overflow: visible; }
  .detail-card.following .detail-extra { display: none; }
  .detail-card.following .detail-heading { margin-bottom: 0; }
  .maplibregl-ctrl-top-right { right: 6px; }
}

.admin-list { display: grid; gap: 8px; }
.admin-item { display: grid; grid-template-columns: minmax(0,1fr) auto auto auto; align-items: center; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.admin-item:last-child { border: 0; }
.admin-item span { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.admin-item button { padding: 7px 9px; }
.admin-item select { width: auto; max-width: 120px; padding: 7px 8px; }
.admin-item .danger { background: #f6e9e7; color: var(--red); }
