
/* ==========================================================
   ABEOJEMAP — PREMIUM GLASSMORPHISM GIS
   FINAL CONSOLIDATED STYLESHEET
   Mobile + Desktop | Leaflet Compatible
========================================================== */

/* =========================
   1. DESIGN TOKENS & RESET
========================= */

:root {
  --joe-blue: #0878d1;
  --joe-blue-dark: #0756a5;
  --joe-blue-soft: rgba(8, 120, 209, 0.10);
  --joe-yellow: #ffd700;
  --joe-yellow-border: #eab308;
  --joe-ink: #0f172a;
  --joe-text: #334155;
  --joe-muted: #64748b;
  --joe-border: rgba(148, 163, 184, 0.28);
  --joe-glass: rgba(255, 255, 255, 0.88);
  --joe-glass-strong: rgba(255, 255, 255, 0.96);
  --joe-shadow: 0 14px 38px rgba(15, 23, 42, 0.22);
  --joe-radius: 18px;
  --joe-safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, Helvetica, Arial, sans-serif;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  position: fixed;
  inset: 0;
  background: #e2e8f0;
  color: var(--joe-ink);
  -webkit-text-size-adjust: 100%;
}

button,
input {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--joe-blue);
  outline-offset: 2px;
}

input[type="text"] {
  min-width: 0;
  color: var(--joe-ink);
  background: rgba(255, 255, 255, 0.96);
}

input[type="text"]::placeholder {
  color: #94a3b8;
}

/* =========================
   2. MAP & LEAFLET
========================= */

#map {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  background: #e2e8f0;
}

.leaflet-container {
  font: inherit;
  background: #e2e8f0;
}

.leaflet-top.leaflet-left {
  top: 110px !important;
  left: 15px !important;
}

.leaflet-top.leaflet-right {
  top: 110px !important;
  right: 15px !important;
}

.leaflet-control-zoom {
  overflow: hidden;
  border: 0 !important;
  border-radius: 12px !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.20) !important;
}

.leaflet-control-zoom a {
  width: 38px !important;
  height: 38px !important;
  line-height: 38px !important;
  border: 0 !important;
  background: rgba(255, 255, 255, 0.94) !important;
  color: var(--joe-ink) !important;
}

.leaflet-control-zoom a:hover {
  background: #e2e8f0 !important;
}

/* Satu kontrol zoom: tampil di kiri */

.leaflet-top.leaflet-right .leaflet-control-zoom {
  display: none !important;
}

.leaflet-top.leaflet-left .leaflet-control-zoom {
  display: block !important;
}

/* =========================
   3. FLOATING MAIN MENU
========================= */

#joemapMenu {
  position: fixed;
  left: 20px;
  bottom: calc(22px + var(--joe-safe-bottom));
  z-index: 5000;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: calc(100vw - 40px);
  isolation: isolate;
}

#menuToggle {
  position: relative;
  z-index: 2;
  display: flex;
  flex: 0 0 50px;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 15px;
  background: rgba(15, 23, 42, 0.88);
  color: #fff;
  font-size: 23px;
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  backdrop-filter: blur(18px) saturate(145%);
  -webkit-backdrop-filter: blur(18px) saturate(145%);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.30);
  transition: background-color 0.2s ease, color 0.2s ease,
    border-color 0.2s ease, transform 0.2s ease;
}

#menuToggle .menu-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

#menuToggle:active {
  transform: scale(0.94);
  background: var(--joe-yellow);
  color: var(--joe-ink);
}

#menuToggle[aria-expanded="true"] {
  background: var(--joe-yellow);
  color: var(--joe-ink);
  border-color: var(--joe-yellow-border);
}

#menuItems {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  max-width: calc(100vw - 90px);
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(-12px);
  transition: opacity 0.22s ease, transform 0.22s ease,
    visibility 0.22s ease;
  -webkit-overflow-scrolling: touch;
}

#menuItems::-webkit-scrollbar {
  display: none;
}

#joemapMenu.active #menuItems {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(0);
}

.menu-btn {
  position: relative;
  display: flex;
  flex: 0 0 44px;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.86);
  color: #fff;
  font-size: 18px;
  white-space: nowrap;
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.22);
  transition: background-color 0.2s ease, color 0.2s ease,
    border-color 0.2s ease, transform 0.2s ease;
}

.menu-btn:active {
  transform: scale(0.93);
  background: var(--joe-yellow);
  color: var(--joe-ink);
}

.menu-btn.active {
  background: var(--joe-yellow) !important;
  color: var(--joe-ink) !important;
  border-color: var(--joe-yellow-border) !important;
  box-shadow: 0 4px 15px rgba(234, 179, 8, 0.30);
}

/* =========================
   4. GLASS PANELS — SHARED
========================= */

.glass-panel {
  position: fixed;
  left: 20px;
  right: 20px;
  bottom: calc(88px + var(--joe-safe-bottom));
  z-index: 4500;
  display: none;
  flex-direction: column;
  width: auto;
  max-width: 380px;
  max-height: calc(100dvh - 120px - var(--joe-safe-bottom));
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: var(--joe-radius);
  background: var(--joe-glass);
  color: var(--joe-ink);
  box-shadow: var(--joe-shadow);
  opacity: 0;
  transform: translateY(8px);
  backdrop-filter: blur(22px) saturate(155%);
  -webkit-backdrop-filter: blur(22px) saturate(155%);
  transition: opacity 0.2s ease, transform 0.2s ease;
  contain: layout style;
}

.glass-panel.show {
  display: flex;
  flex-direction: column;
  opacity: 1;
  transform: translateY(0);
}

.panel-header {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 54px;
  padding: 13px 16px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.09);
  background: linear-gradient(
    135deg,
    rgba(8, 120, 209, 0.09),
    rgba(255, 215, 0, 0.12)
  );
}

.panel-header h3 {
  color: var(--joe-ink);
  font-size: 15px;
  font-weight: 750;
  line-height: 1.4;
  letter-spacing: -0.2px;
}

.close-btn {
  display: flex;
  flex: 0 0 36px;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  min-height: 36px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--joe-muted);
  font-size: 23px;
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
  transition: background-color 0.18s ease, color 0.18s ease;
}

.close-btn:active {
  background: var(--joe-yellow);
  color: var(--joe-ink);
}

.panel-body {
  flex: 1 1 auto;
  min-height: 0;
  padding: 14px 16px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}

.glass-panel .panel-body::-webkit-scrollbar {
  width: 5px;
}

.glass-panel .panel-body::-webkit-scrollbar-thumb {
  border-radius: 10px;
  background: rgba(100, 116, 139, 0.45);
}

.glass-panel .panel-body::-webkit-scrollbar-track {
  background: transparent;
}

/* ID panel dipertahankan untuk JavaScript */

#panelLayers,
#panelMeasure,
#panelCoordinate {
  width: min(380px, calc(100vw - 32px));
}

#panelLayers .panel-header h3,
#panelCoordinate .panel-header h3 {
  letter-spacing: -0.2px;
}

/* =========================
   5. LAYER GROUPS & CHECKBOXES
========================= */

.layer-group {
  margin-bottom: 14px;
}

.layer-group:last-child {
  margin-bottom: 0;
}

.group-title {
  display: block;
  margin-bottom: 7px;
  color: var(--joe-muted);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.5;
  letter-spacing: 0.75px;
}

.checkbox-item,
.radio-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 10px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--joe-text);
  font-size: 12px;
  line-height: 1.45;
  cursor: pointer;
  transition: background-color 0.16s ease, border-color 0.16s ease;
}

.checkbox-item:hover,
.radio-item:hover {
  background: rgba(8, 120, 209, 0.07);
}

.checkbox-item:active,
.radio-item:active {
  background: rgba(255, 215, 0, 0.22);
}

.checkbox-item input,
.radio-item input {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--joe-yellow);
  cursor: pointer;
}

.checkbox-item span,
.radio-item span {
  min-width: 0;
  overflow-wrap: anywhere;
}

#panelLayers .layer-group {
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.22);
}

#panelLayers .layer-group:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: 0;
}

#panelLayers .group-title {
  padding: 0 7px;
}

#panelLayers .checkbox-item {
  min-height: 44px;
  margin-bottom: 2px;
  border-color: transparent;
}

#panelLayers .checkbox-item:last-child {
  margin-bottom: 0;
}

#panelLayers .checkbox-item:has(input:checked) {
  border-color: rgba(234, 179, 8, 0.42);
  background: rgba(255, 215, 0, 0.17);
  color: var(--joe-ink);
}

#panelLayers .checkbox-item span:not(#ppkhStatus) {
  flex: 1 1 auto;
}

#ppkhStatus {
  flex: 0 0 auto;
  margin-left: auto;
  padding: 3px 7px;
  border-radius: 20px;
  background: #e2e8f0;
  color: #475569;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.4px;
}

#ppkhStatus.active,
#ppkhStatus.on {
  background: #dcfce7;
  color: #166534;
}

/* =========================
   6. BUTTONS & INPUTS
========================= */

.action-tab-btn {
  min-height: 40px;
  border: 1px solid rgba(148, 163, 184, 0.34);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--joe-text);
  cursor: pointer;
  touch-action: manipulation;
  transition: background-color 0.18s ease, color 0.18s ease,
    border-color 0.18s ease, transform 0.18s ease;
}

.action-tab-btn:active {
  transform: scale(0.98);
  background: var(--joe-yellow) !important;
  color: var(--joe-ink) !important;
  border-color: var(--joe-yellow-border) !important;
}

.action-tab-btn.active {
  background: var(--joe-yellow) !important;
  color: var(--joe-ink) !important;
  border-color: var(--joe-yellow-border) !important;
  box-shadow: 0 4px 15px rgba(234, 179, 8, 0.25);
}

#measureResult,
#gpsStatus {
  overflow-wrap: anywhere;
  line-height: 1.5;
}

/* Tombol pengukuran */

#panelMeasure #btnMeasureDist,
#panelMeasure #btnMeasureArea,
#panelMeasure #btnClearMeasure {
  position: relative;
  min-height: 40px;
  pointer-events: auto;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
}

#panelMeasure #btnClearMeasure {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 10px;
  border: 0;
  border-radius: 9px;
  background: #ef4444;
  color: #fff;
  font-weight: 700;
}

#panelMeasure #btnClearMeasure:active {
  background: #dc2626;
  color: #fff;
}

/* =========================
   7. UPLOAD DROPZONE & FILES
========================= */

.upload-dropzone {
  padding: 20px 12px;
  border: 2px dashed rgba(8, 120, 209, 0.45);
  border-radius: 12px;
  background: rgba(8, 120, 209, 0.045);
  text-align: center;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.upload-dropzone:hover {
  border-color: var(--joe-blue);
  background: rgba(8, 120, 209, 0.09);
}

.upload-dropzone p {
  color: #1e293b;
  font-size: 13px;
  line-height: 1.6;
}

.upload-dropzone strong {
  color: var(--joe-blue);
}

.uploaded-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 7px;
  padding: 8px 10px;
  border: 1px solid rgba(15, 23, 42, 0.06);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.58);
  font-size: 12px;
}

.uploaded-item span {
  min-width: 0;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.uploaded-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 7px;
}

.action-btn {
  padding: 5px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--joe-text);
  font-size: 14px;
  cursor: pointer;
  touch-action: manipulation;
  transition: background-color 0.18s ease, color 0.18s ease;
}

.action-btn:active {
  background: var(--joe-yellow) !important;
  color: var(--joe-ink) !important;
}

/* =========================
   8. COORDINATE PICKER
========================= */

#coordinateCrosshair.abejoe-coordinate-crosshair {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 1200;
  display: none;
  width: 36px;
  height: 36px;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

#coordinateCrosshair.abejoe-coordinate-crosshair.active {
  display: block;
}

#coordinateCrosshair::before,
#coordinateCrosshair::after {
  position: absolute;
  border-radius: 2px;
  background: #ef4444;
  content: "";
  box-shadow: 0 0 3px #fff, 0 0 6px rgba(0, 0, 0, 0.45);
}

#coordinateCrosshair::before {
  top: 0;
  left: 17px;
  width: 2px;
  height: 36px;
}

#coordinateCrosshair::after {
  top: 17px;
  left: 0;
  width: 36px;
  height: 2px;
}

#coordinateCrosshair .crosshair-center {
  position: absolute;
  top: 13px;
  left: 13px;
  width: 10px;
  height: 10px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #ef4444;
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.55);
}

#panelCoordinate .panel-body {
  gap: 0;
}

.coordinate-picker {
  padding: 12px;
  border: 1px solid var(--joe-border);
  border-radius: 14px;
  background: linear-gradient(
    145deg,
    rgba(248, 250, 252, 0.96),
    rgba(239, 246, 255, 0.88)
  );
}

.coordinate-picker-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.coordinate-picker-title .group-title {
  margin-bottom: 0;
}

.coordinate-status {
  flex: 0 0 auto;
  padding: 4px 7px;
  border-radius: 20px;
  background: #e2e8f0;
  color: #475569;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.4px;
}

.coordinate-status.active {
  background: #dcfce7;
  color: #166534;
}

.coordinate-instruction {
  margin: 9px 0 12px;
  color: var(--joe-muted);
  font-size: 12px;
  line-height: 1.55;
}

.coordinate-values {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.coordinate-value {
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.82);
}

.coordinate-value span {
  display: block;
  margin-bottom: 5px;
  color: var(--joe-muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.6px;
}

.coordinate-value strong {
  display: block;
  overflow-wrap: anywhere;
  color: var(--joe-ink);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 12px;
  line-height: 1.5;
}

.coordinate-text {
  margin-top: 9px;
  padding: 9px 10px;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.045);
  color: #475569;
  font-size: 11px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.coordinate-actions {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 8px;
  margin-top: 10px;
}

.coordinate-btn {
  min-height: 40px;
  padding: 9px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--joe-text);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
  transition: background-color 0.18s ease, transform 0.18s ease;
}

.coordinate-btn-primary {
  border-color: var(--joe-blue);
  background: var(--joe-blue);
  color: #fff;
}

.coordinate-btn-copy {
  width: 100%;
  margin-top: 8px;
}

.coordinate-btn-full {
  width: 100%;
  margin-top: 9px;
}

.coordinate-btn:active {
  transform: scale(0.98);
  background: var(--joe-yellow);
  color: var(--joe-ink);
}

.coordinate-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.coordinate-stop-btn {
  width: 100%;
  margin-top: 8px;
  padding: 7px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--joe-muted);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}

.coordinate-stop-btn:active {
  background: #fee2e2;
  color: #b91c1c;
}

.coordinate-divider {
  height: 1px;
  margin: 14px 0;
  background: var(--joe-border);
}

.coordinate-section {
  margin-bottom: 14px;
}

.coordinate-section:last-child {
  margin-bottom: 0;
}

.current-coords-display {
  padding: 10px;
  border: 1px solid var(--joe-border);
  border-radius: 9px;
  background: rgba(248, 250, 252, 0.92);
  color: var(--joe-text);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 12px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.coordinate-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.coordinate-inputs input {
  width: 100%;
  min-height: 40px;
  padding: 9px;
  border: 1px solid #cbd5e1;
  border-radius: 9px;
  font-size: 13px;
}

/* =========================
   9. TABLET & MOBILE
========================= */

@media (max-width: 900px) {
  .glass-panel {
    max-height: calc(100dvh - 110px - var(--joe-safe-bottom));
  }
}

@media (max-width: 600px) {
  #joemapMenu {
    right: 12px;
    bottom: calc(18px + var(--joe-safe-bottom));
    left: 12px;
    width: auto;
    max-width: none;
    gap: 8px;
  }

  #menuToggle {
    flex-basis: 46px;
    width: 46px;
    height: 46px;
    border-radius: 14px;
  }

  #menuItems {
    flex: 1 1 auto;
    width: 0;
    max-width: none;
    gap: 6px;
    padding: 2px 1px;
  }

  .menu-btn {
    flex-basis: 42px;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    font-size: 17px;
  }

  .glass-panel {
    right: 12px;
    bottom: calc(78px + var(--joe-safe-bottom));
    left: 12px;
    width: auto;
    max-width: none;
    max-height: min(
      72dvh,
      calc(100dvh - 112px - var(--joe-safe-bottom))
    );
    border-radius: 16px;
  }

  .panel-header {
    min-height: 50px;
    padding: 11px 13px;
  }

  .panel-body {
    padding: 10px 12px;
  }

  #panelLayers .panel-body {
    padding: 10px 12px;
  }

  #panelLayers .checkbox-item {
    min-height: 44px;
    padding: 10px;
  }

  #panelCoordinate {
    right: 12px;
    left: 12px;
    width: auto;
  }

  #coordinateCrosshair.abejoe-coordinate-crosshair {
    width: 32px;
    height: 32px;
  }

  #coordinateCrosshair::before {
    left: 15px;
    height: 32px;
  }

  #coordinateCrosshair::after {
    top: 15px;
    width: 32px;
  }

  #coordinateCrosshair .crosshair-center {
    top: 11px;
    left: 11px;
  }

  .coordinate-picker {
    padding: 10px;
  }

  .coordinate-value strong {
    font-size: 11px;
  }

  .leaflet-top.leaflet-left {
    top: 100px !important;
    left: 12px !important;
  }

  .leaflet-top.leaflet-right {
    top: 100px !important;
    right: 12px !important;
  }
}

/* Layar pendek / HP landscape */

@media (max-height: 500px) {
  #joemapMenu {
    bottom: calc(8px + var(--joe-safe-bottom));
  }

  .glass-panel {
    bottom: calc(62px + var(--joe-safe-bottom));
    max-height: calc(100dvh - 72px - var(--joe-safe-bottom));
  }

  .panel-body {
    padding-top: 8px;
    padding-bottom: 8px;
  }

  .leaflet-top.leaflet-left,
  .leaflet-top.leaflet-right {
    top: 12px !important;
  }
}

/* =========================
   10. DESKTOP HOVER
========================= */

@media (hover: hover) and (pointer: fine) {
  #menuToggle:hover,
  .menu-btn:hover {
    background: var(--joe-blue);
    color: #fff;
  }

  .menu-btn.active:hover {
    background: var(--joe-yellow) !important;
    color: var(--joe-ink) !important;
  }

  .action-tab-btn:hover {
    border-color: rgba(8, 120, 209, 0.38);
    background: rgba(8, 120, 209, 0.08);
  }

  .action-tab-btn.active:hover {
    background: var(--joe-yellow) !important;
    color: var(--joe-ink) !important;
  }

  .close-btn:hover {
    background: rgba(15, 23, 42, 0.08);
    color: var(--joe-ink);
  }

  .action-btn:hover {
    background: rgba(8, 120, 209, 0.10);
  }

  .coordinate-btn:hover {
    border-color: var(--joe-blue);
  }
}

/* =========================
   11. ACCESSIBILITY
========================= */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
/* ==========================================================
ABEOJEMAP — FINAL FIX POSISI TOMBOL HP
Tombol menu dinaikkan agar mudah terlihat dan disentuh
Desktop tidak berubah
========================================================== */

@media screen and (max-width: 600px) {
#joemapMenu {
position: fixed !important;
left: 12px !important;
right: 12px !important;

    /* Naikkan menu dari tepi bawah layar */
    bottom: calc(110px + env(safe-area-inset-bottom, 0px)) !important;

    width: auto !important;
    max-width: none !important;

    z-index: 20000 !important;

    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
}

#menuToggle {
    position: relative !important;
    z-index: 20001 !important;
    flex: 0 0 48px !important;
    width: 48px !important;
    height: 48px !important;
    pointer-events: auto !important;
    touch-action: manipulation !important;
}

#menuItems {
    position: relative !important;
    z-index: 20001 !important;
    min-width: 0 !important;
    max-width: calc(100vw - 82px) !important;
}

#menuItems .menu-btn {
    flex: 0 0 42px !important;
    width: 42px !important;
    height: 42px !important;
    pointer-events: auto !important;
    touch-action: manipulation !important;
}

}

/* HP dalam posisi landscape atau layar pendek */
@media screen and (max-width: 600px) and (max-height: 500px) {
#joemapMenu {
bottom: calc(65px + env(safe-area-inset-bottom, 0px)) !important;
}
}

/* =====================================================
   ABEOJEMAP — FIX POSISI GIS LAYERS MOBILE
   Panel naik, tombol tidak bertabrakan
   ===================================================== */

@media screen and (max-width: 768px) {

  /* Panel GIS Layers */
  #joemapMenu {
    bottom: calc(110px + env(safe-area-inset-bottom)) !important;
    left: 12px !important;
    right: 12px !important;

    width: auto !important;
    max-width: none !important;

    max-height: calc(
      100dvh - 190px - env(safe-area-inset-top)
    ) !important;

    overflow-y: auto !important;
    overflow-x: hidden !important;

    box-sizing: border-box !important;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  /* Tombol utama kiri bawah */
  #btnToggleMenu,
  #btnMeasureDist,
  #btnMeasureArea,
  #btnClearMeasure {
    z-index: 1200 !important;
    pointer-events: auto !important;
  }

  /* Jika tombol mengambang memakai class Leaflet */
  .leaflet-control {
    z-index: 1200 !important;
  }

  /* Pastikan panel berada di bawah tombol mengambang */
  #joemapMenu {
    z-index: 1100 !important;
  }
}
