#map {
  width: 100%;
  height: 100vh;
}

.layer-toolbar {
  position: absolute;
  bottom:75px;  /* Changed from top to bottom */
  left: 10px;    /* Changed from right to left */
  z-index: 1000;
}

.layer-panel {
  position: absolute;
  bottom: 0%;  /* Changed from top to bottom */
  left: 120%;       /* Changed from right to left */
  background: #d5ffe2;
  padding: 10px;
  border-radius: 10px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  min-width: 120px;
  margin-bottom: 10px; /* Added margin to create space between panel and button */
}

.layer-panel.hidden {
  display: none;
}

.layer-option {
  margin: 5px 0;
  display: flex;
  align-items: center;
  gap: 5px;
}

.layer-option input[type="radio"] {
  margin: 0;
  accent-color: #04f80c; /* This sets the color of the radio button */
}


.layer-option label {
  cursor: pointer;
  font-size: 13px;
  color: #333333;
  font-family: verdana;

}

#layerToggleBtn {
  background: white;
  border: none;
  border-radius: 6px;
  padding: 2px;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  transition: all 0.3s ease;
}

#layerToggleBtn:hover {
  background: #c4c4c2;
  transform: scale(1.05);
}

#layerToggleBtn img {
  width: 40px;
  height: 40px;
  margin: auto; /* Centers the icon within the button */

}

.controls {
  position: absolute;
  top: 1%;
  left: 50%;
  transform: translateX(-50%);
  background: #106c43;
  padding: 10px;
  border-radius: 5px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.3);
  z-index: 1000;
  display: flex;
  gap: 10px;
  font-family: "Lucida Console", "Courier New", monospace;
  color: rgb(3, 3, 3);
}

.controls label {
  display: flex;
  align-items: center;
}

.controls img {
  width: 24px;
  height: 24px;
  margin-right: 5px;
}




.toolbar {
  position: absolute;
  top: 25%;
  right: 1%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.3);
  z-index: 1000;
}

.toolbar button {
  background: white;
  border: none;
  padding: 8px;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  border-bottom: 1px solid #ddd;
  position: relative;
}

.toolbar button:last-child {
  border-bottom: none;
}

.toolbar button.active {
  background: #e0f7fa;
}

.toolbar button:hover {
  background: #e0e0e0;
}

.toolbar button img {
  width: 24px;
  height: 24px;
}

.toolbar button::after {
  content: attr(title);
  position: absolute;
  top: 50%;
  right: 100%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}

.toolbar button:hover::after {
  opacity: 1;
}

/* Add transparent space with custom background between Draw Circle and Modify buttons */ 
.toolbar .spacer { height: 16px; /* Adjust the value as needed */ 
  background: rgb(179, 181, 179);
   }



.marker-popup {
  position: absolute;
  background:url(Map-img/CONTOUR-LINE-POPUP.png);
  box-shadow: 1px 4px rgba(0,0,0,0.2);
  padding: 10px;
  border-radius: 15px;
  border: 1px solid #cccccc;
  bottom: 20px;
  left: -50px;
  min-width: 120px;
  font-family: Arial, sans-serif;
  font-size: 12px;
}

.popup-closer {
  position: absolute;
  top: 2px;
  right: 8px;
  text-decoration: none;
  color: #ff0000;
  cursor: pointer;
}

.itinerary-btn {
  background: #007bff;
  color: white;
  border: none;
  padding: 5px 15px;
  border-radius: 4px;
  margin-top: 8px;
  cursor: pointer;
  width: 100%;
}

.itinerary-btn:hover {
  background: #0056b3;
}

#deleteButtonsContainer {
  position: absolute;
  top: 50%; /* Adjust this value to match the toolbar */
  right: 5%; /* Match this with the toolbar's right position */
  transform: translateY(-70%);
}
.measure-toolbar {
  position: absolute;
  top: 20%;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.3);
  z-index: 1000;
  display: flex;
  flex-direction: column; /* Change layout to column */
  gap: 5px;
  padding: 5px;
}

.measure-toolbar button {
  background: white;
  border: none;
  padding: 8px;
  cursor: pointer;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.measure-toolbar button:hover {
  background: #f0f0f0;
}

.measure-toolbar button img {
  width: 24px;
  height: 24px;
}
#settings-container {
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: white;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  padding: 5px;
}

#settings-button {
  transition: transform 0.2s;
}

#settings-button:hover {
  transform: scale(1.1);
}


.tooltip {
  position: relative;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 4px;
  color: white;
  padding: 4px 8px;
  opacity: 0.7;
  white-space: nowrap;
}
.tooltip-measure {
  opacity: 1;
  font-weight:bolder;
}
.tooltip-static {
  background-color: #33e7ff;
  color: black;
  border: 1px solid white;
}
#map {
  width: 100%;
  height: 100vh;
  position: relative;
}

.bottom-buttons {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  z-index: 1000;
}

.import-container,
.print-container,
.export-container {
  background-color: white;
  border-radius: 100%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  padding: 5px;
  display: flex;
  gap: 5px;
  justify-content: center;
  z-index: 1000;
  position: relative;
}

/* --- BUTTON STYLING FIXES START HERE --- */
.import-btn,
.print-btn,
.export-btn {
  background-color: #ffffff;
  border: none;
  padding: 10px;
  border-radius: 100%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  font-family: Arial, sans-serif;
  font-size: 14px;
  color: #000000;
  width: 50px;
  height: 50px;
  position: relative;
  
  /* CRITICAL FIXES FOR PRINT BUTTON: */
  outline: none;            /* Removes the green/blue square focus ring */
  box-shadow: none;         /* Removes any default button shadow */
  -webkit-appearance: none; /* Removes operating system specific button styling */
  appearance: none;         /* Standard property for the above */
  margin: 0;                /* Ensures no default margins offset the center */
}
/* --- FIXES END --- */

.import-btn:hover,
.print-btn:hover,
.export-btn:hover {
  background-color: #106c43;
  color: #fdbf2d;
}

.import-btn::before,
.print-btn::before,
.export-btn::before {
  content: '';
  display: block;
  width: 40px;
  height: 40px;
  background: currentColor;
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center center;
  mask-position: center center;
}

.import-btn::before {
  -webkit-mask-image: url("Map-img/folder.svg");
  mask-image: url("Map-img/folder.svg");
}

.print-btn::before {
  -webkit-mask-image: url("Map-img/print-icon.svg");
  mask-image: url("Map-img/print-icon.svg");
}

.export-btn::before {
  -webkit-mask-image: url("Map-img/Export 1.svg");
  mask-image: url("Map-img/Export 1.svg");
}

/* Tooltips */
/* 1. Main Button Styles - Strict Reset */
.import-btn,
.print-btn,
.export-btn {
  width: 50px;
  height: 50px;
  background-color: #ffffff !important; /* Forces white background */
  color: #000000 !important;            /* Forces black icon */
  border-radius: 50% !important;        /* Forces perfect circle */
  border: none !important;              /* Removes gray borders */
  outline: none !important;             /* Removes the GREEN RECTANGLE */
  box-shadow: none !important;          /* Removes extra shadows */
  padding: 0;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
       /* Removes system button styles */
}

/* 2. Hover Styles */
.import-btn:hover,
.print-btn:hover,
.export-btn:hover {
  background-color: #106c43 !important;
  color: #fdbf2d !important;
}

/* 3. Icon Sizing (The ::before element) */
.import-btn::before,
.print-btn::before,
.export-btn::before {
  content: '';
  display: block;
  width: 30px;  /* Reduced from 40px to fit better inside the circle */
  height: 30px; /* Reduced from 40px to fit better inside the circle */
  background-color: currentColor; /* Follows the button color (Black -> Yellow) */
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center center;
  mask-position: center center;
}

/* 4. Active/Click Effect */
.import-btn:active,
.print-btn:active,
.export-btn:active {
  transform: scale(0.95);
}

.import-btn:hover::after,
.print-btn:hover::after,
.export-btn:hover::after {
  opacity: 1;
}

/* Dropdowns */
.import-dropdown,
.export-dropdown {
  display: none;
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: white;
  border: 1px solid #ddd;
  border-radius: 10px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  margin-bottom: 4px;
  z-index: 1000;
  white-space: nowrap;
}

.import-container:hover .import-dropdown,
.export-container:hover .export-dropdown {
  display: block;
}

.import-option,
.export-option {
  padding: 8px 16px;
  cursor: pointer;
  white-space: nowrap;
}

.import-option:hover,
.export-option:hover {
  background-color: #d5ffe2;
}

/* Active state for click effect */
.import-btn:active,
.print-btn:active,
.export-btn:active {
  transform: scale(0.95);
}

/* Mobile styles remain the same, hiding bottom-buttons on mobile */
@media only screen and (max-width: 768px) {
  .bottom-buttons {
    display: none;
  }
}
/* Force search bar always visible on desktop */
@media screen and (min-width: 769px) {
  .search-bar {
    display: flex !important;
    opacity: 1 !important;
    visibility: visible !important;
  }
}

.search-bar {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 1000;
  display: flex;
  gap: 5px;
  background: white;
  padding: 5px;
  border-radius: 5px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.search-bar input {
  padding: 5px;
  font-size: 14px;
}

.search-bar button {
  padding: 5px 10px;
  font-size: 14px;
  cursor: pointer;
  background-color: #0078d7;
  color: white;
  border: none;
  border-radius: 3px;
}

#locationButton {
  position: absolute;
  bottom: 10px;
  left: 10px;
  z-index: 1000;
  background: white; /* White background */
  border: 1px solid #ccc; /* Optional: light gray border for better visibility */
  padding: 5px; /* Add spacing around the icon */
  border-radius: 8px; /* Optional: rounded corners */
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); /* Optional: subtle shadow */
}

#locationButton img {
  width: 45px; /* Adjust size as needed */
  height: 45px;
  display: block; /* Ensures proper alignment */
  margin: auto; /* Centers the icon within the button */
}

#locationButton:hover {
  background: #f0f0f0; /* Light gray hover effect */
}

/* Mobile-specific styles */
@media only screen and (max-width: 768px) {
  /* Controls repositioning */
  .controls {
    top: 10px;
    left: 50%;
    transform: none;
    flex-direction: column;
    transform: translateX(-50%);
    width: calc(100% - 20px);
    max-width:150px;
  background: #106c43;
    border-radius: 20px;
    padding: 8px;
    font-family: "Lucida Console", "Courier New", monospace;
  color: rgb(0, 0, 0);
  }

  /* Hide desktop toolbars */
  .toolbar, .measure-toolbar {
    display: none;
  }

  /* Search bar repositioning */
  .search-bar {
    bottom: 70px;
    top: auto;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 20px);
    max-width: 400px;
    background: #106c43;
    border-radius: 20px;
    padding: 8px;
  }

  .search-bar input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 14px;
  }

  /* Bottom navigation bar */
  .mobile-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: white;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    z-index: 1000;
    justify-content: space-around;
    padding: 8px 0;
  }

  .mobile-nav button {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: none;
    border: none;
    padding: 5px;
    color: #666;
    font-size: 12px;
    gap: 4px;
  }

  .mobile-nav button img {
    width: 24px;
    height: 24px;
  }

  .mobile-nav button.active {
    color: #4CAF50;
  }

  /* Layer control repositioning */
  .layer-toolbar {
    bottom: 310px;
    left: 10px;
  }

  /* Import/Export buttons repositioning */
  .import-container, .export-container {
    display: none; /* Hidden in mobile as they're moved to bottom nav */
  }

  /* Location button repositioning */
  #locationButton {
    bottom: 250px;
   left:10px;
  }

  /* Mobile drawing tools panel (initially hidden) */
  .mobile-drawing-tools {
    position: fixed;
    bottom: 60px;
    left: 0;
    width: 100%;
    background: white;
    padding: 10px;
    display: none;
    justify-content: space-around;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    z-index: 999;
  }

  .mobile-drawing-tools.active {
    display: flex;
  }

  .mobile-drawing-tools button {
    padding: 8px;
    background: none;
    border: none;
  }

  .mobile-drawing-tools button img {
    width: 24px;
    height: 24px;
  }
}
/* Mobile measurement panel */
.mobile-measurement {
  position: fixed;
  bottom: 60px;
  left: 0;
  width: 100%;
  background: white;
  padding: 10px;
  display: none;
  justify-content: space-around;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
  z-index: 999;
}

.mobile-measurement.active {
  display: flex;
}

.mobile-measurement button {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: none;
  border: none;
  padding: 8px;
  color: #666;
  font-size: 12px;
  gap: 4px;
}

.mobile-measurement button img {
  width: 24px;
  height: 24px;
}

.mobile-measurement button.active {
  color: #4CAF50;
}

/* Import/Export panels */
.mobile-import-panel,
.mobile-export-panel {
  position: fixed;
  bottom: 60px;
  left: 0;
  width: 100%;
  background: white;
  padding: 10px;
  display: none;
    justify-content: space-around;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
  z-index: 999;
}

.mobile-import-panel.active,
.mobile-export-panel.active {
  display: flex;
}

.mobile-import-panel button,
.mobile-export-panel button {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: none;
  border: none;
  padding: 8px;
  color: #666;
  font-size: 12px;
  gap: 4px;
}

.mobile-import-panel button:last-child,
.mobile-export-panel button:last-child {
  border-bottom: none;
}
/* Add these rules to your main.css */

/* Hide mobile elements on desktop */
.mobile-nav,
.mobile-drawing-tools,
.mobile-measurement,
.mobile-import-panel,
.mobile-export-panel {
    display: none;
}

/* Mobile-specific styles */
@media only screen and (max-width: 768px) {
    /* Show mobile navigation */
    .mobile-nav {
        display: flex;
    }

    /* Hide desktop elements */
    .toolbar,
    .measure-toolbar,
    .import-container,
    .export-container {
        display: none !important;
    }

    /* Show mobile panels when active */
    .mobile-drawing-tools.active,
    .mobile-measurement.active,
    .mobile-import-panel.active,
    .mobile-export-panel.active {
        display: flex;
    }
}

/* Desktop-specific styles */
@media only screen and (min-width: 769px) {
    /* Show desktop elements */
    .toolbar,
    .measure-toolbar,
    .import-container,
    .export-container {
        display: flex;
    }

    /* Hide mobile elements */
    .mobile-nav,
    .mobile-drawing-tools,
    .mobile-measurement,
    .mobile-import-panel,
    .mobile-export-panel {
        display: none !important;
    }
    
    
}
.mobile-measurement {
  position: fixed;
  bottom: 60px;
  left: 0;
  width: 100%;
  background: white;
  padding: 10px;
  display: none;
  flex-wrap: wrap;
  justify-content: space-around;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
  z-index: 999;
}

.mobile-measurement.active {
  display: flex;
}

.mobile-measurement button {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: none;
  border: none;
  padding: 8px;
  color: #666;
  font-size: 12px;
  gap: 4px;
}

.mobile-measurement button img {
  width: 24px;
  height: 24px;
}

.mobile-measurement button.active {
  color: #4CAF50;
}
#homeButton {
  position: absolute;
  bottom: 140px;
  left: 10px;
  z-index: 1000; /* Ensure it's above the map */
  background-color: #ffffff;
  border: 1px solid #ccc;
  border-radius: 5px;
  padding: 10px;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

#homeButton img {
  width: 25px;
  height: 25px;
}

#homeButton:hover {
  background-color: #c8c8c8;
}

/* Mobile-specific styles */
@media (max-width: 768px) {
  #homeButton {
      bottom: 185px;
      left: 10px;
      padding: 10px;
  }

  #homeButton img {
      width: 24px;
      height: 24px;
  }
}



/* ADD THIS CSS TO YOUR MAIN.CSS FILE OR CREATE A NEW print.css FILE */
/* ==========================================================================
   MODERN PRINT MODAL - FINAL VERSION
   ========================================================================== */
.print-modal {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.6); z-index: 10000;
    display: flex; align-items: center; justify-content: center;
    backdrop-filter: blur(4px);
}
.print-modal.hidden { display: none; }

.print-container-modal {
    display: flex; width: 95%; height: 90vh; max-width: 1300px;
    background: #ffffff; border-radius: 16px; overflow: hidden;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3);
}

/* SIDEBAR */
.print-sidebar {
    width: 360px; background: #ffffff;
    display: flex; flex-direction: column;
    border-right: 1px solid #f0f0f0; z-index: 10;
}

.print-header {
    padding: 20px 24px; border-bottom: 1px solid #f0f0f0;
    display: flex; justify-content: space-between; align-items: center;
}
.print-header h2 { margin: 0; font-size: 20px; font-weight: 700; color: #1f2937; }

.print-content { flex: 1; overflow-y: auto; padding: 24px; background: #fff; }

.print-section { margin-bottom: 24px; }

.section-title {
    margin: 0 0 12px 0; font-size: 14px;
    font-weight: 600; color: #6b7280; text-transform: uppercase; letter-spacing: 0.5px;
}
.section-label {
    display: block; margin-bottom: 8px; font-size: 14px; font-weight: 600; color: #374151;
}

/* INPUT STYLES */
.title-input {
    width: 100%; padding: 12px 16px; background: #f9fafb;
    border: 1px solid #e5e7eb; border-radius: 12px;
    font-size: 15px; color: #1f2937; outline: none; transition: 0.2s;
}
.title-input:focus { border-color: #10b981; background: #fff; }

/* BUTTON GROUP LAYOUT */
.button-group { display: flex; flex-wrap: wrap; gap: 8px; }

/* === 1. PILL BUTTONS (Paper/Orientation) === */
.pill-btn {
    padding: 10px 20px; background: #f3f4f6; border: none;
    border-radius: 999px; font-size: 14px; font-weight: 500;
    color: #4b5563; cursor: pointer; transition: all 0.2s;
}
.pill-btn:hover { background: #e5e7eb; }
.pill-btn.active {
    background: #10b981; color: white;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

/* === 2. QUALITY CHIPS (Colors) === */
.quality-chip {
    padding: 10px 18px; background: #f3f4f6; border: none;
    border-radius: 999px; font-size: 13px; font-weight: 600;
    color: #6b7280; cursor: pointer; transition: all 0.2s;
}
/* Specific Colors */
.quality-standard.active { background: #f59e0b; color: white; box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3); }
.quality-high.active { background: #f97316; color: white; box-shadow: 0 4px 12px rgba(249, 115, 22, 0.3); }
.quality-best.active { background: #10b981; color: white; box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3); }
.quality-draft.active { background: #6b7280; color: white; }

/* === 3. TOGGLE CHIPS (Legend) === */
.toggle-chip {
    padding: 8px 16px; background: #fff; border: 1px solid #e5e7eb;
    border-radius: 8px; font-size: 13px; font-weight: 500;
    color: #374151; cursor: pointer; transition: all 0.2s;
}
.toggle-chip:hover { border-color: #d1d5db; }
.toggle-chip.active {
    background: #ecfdf5; border-color: #10b981; color: #047857; font-weight: 600;
}

/* FOOTER BUTTON */
.print-footer { padding: 20px 24px; border-top: 1px solid #f0f0f0; }
.print-execute-btn {
    width: 100%; padding: 16px; background: #10b981; color: white;
    border: none; border-radius: 12px; font-size: 16px; font-weight: 600;
    cursor: pointer; box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    transition: 0.2s; display: flex; align-items: center; justify-content: center; gap: 8px;
}
.print-execute-btn:hover { background: #059669; transform: translateY(-1px); }

/* MAP PREVIEW AREA */
.print-map-area {
    flex: 1; background: #f3f4f6; overflow: hidden;
    display: flex; align-items: center; justify-content: center;
}
.print-map-wrapper {
    transform: scale(0.65); box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    background: white; transition: transform 0.3s ease;
}
.print-map-container {
    width: 794px; height: 1123px; /* A4 Default */
    display: flex; flex-direction: column; background: white;
}
.print-map-header { padding: 25px; text-align: center; border-bottom: 1px solid #f0f0f0; }
.print-map-header h1 { font-size: 28px; margin: 0; color: #111827; }
.print-map-content { flex: 1; position: relative; }
.print-map-display { width: 100%; height: 100%; background: #f9fafb; }
.map-placeholder { height: 100%; display: flex; align-items: center; justify-content: center; color: #9ca3af; }

/* Overlays */
.print-elements { position: absolute; bottom: 30px; left: 30px; width: 100%; pointer-events: none; }
.scale-bar-new { background: rgba(255,255,255,0.95); padding: 8px; border-radius: 6px; display: inline-block; box-shadow: 0 2px 5px rgba(0,0,0,0.1); }
.north-arrow-new { position: absolute; bottom: 0; right: 60px; width: 60px; height: 60px; }

/* Close Buttons */
.close-btn-desktop { background: none; border: none; font-size: 28px; color: #9ca3af; cursor: pointer; }
.close-btn-mobile { display: none; }


/* ==========================================================================
   TABLET COMPACT LAYOUT (769px - 1200px)
   Same desktop structure but everything scaled down
   ========================================================================== */
@media (min-width: 769px) and (max-width: 1200px) {
    /* Modal Container - More screen coverage */
   /* Modal - Ensure centered alignment */
.print-modal {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Modal Container - 50% width, centered */
.print-container-modal {
    width: 60%;
    height: 80vh;
    max-width: 1100px;
    border-radius: 14px;
    margin: 0 auto; /* Extra centering insurance */
}

    /* SIDEBAR - Narrower for tablets */
    .print-sidebar {
        width: 280px; /* Reduced from 360px */
    }

    /* Header - More compact */
    .print-header {
        padding: 14px 18px;
    }
    .print-header h2 {
        font-size: 17px;
    }

    /* Content - Tighter spacing */
    .print-content {
        padding: 18px;
    }

    /* Sections - Reduced margins */
    .print-section {
        margin-bottom: 18px;
    }

    .section-title {
        font-size: 12px;
        margin-bottom: 10px;
        letter-spacing: 0.3px;
    }

    .section-label {
        font-size: 13px;
        margin-bottom: 6px;
    }

    /* Input - Smaller */
    .title-input {
        padding: 10px 14px;
        font-size: 14px;
        border-radius: 10px;
    }

    /* Button Groups - Tighter spacing */
    .button-group {
        gap: 6px;
    }

    /* Pill Buttons - Smaller */
    .pill-btn {
        padding: 8px 16px;
        font-size: 13px;
        border-radius: 999px;
    }

    /* Quality Chips - Compact */
    .quality-chip {
        padding: 8px 14px;
        font-size: 12px;
    }

    /* Toggle Chips - Smaller */
    .toggle-chip {
        padding: 6px 12px;
        font-size: 12px;
        border-radius: 7px;
    }

    /* Footer - Compact */
    .print-footer {
        padding: 14px 18px;
    }

    .print-execute-btn {
        padding: 13px;
        font-size: 15px;
        border-radius: 10px;
    }

    /* Map Preview - Smaller scale */
    .print-map-wrapper {
        transform: scale(0.48); /* Reduced from 0.65 */
    }

    .print-map-header {
        padding: 20px;
    }

    .print-map-header h1 {
        font-size: 24px;
    }

    /* Close button - Touch-friendly */
    .close-btn-desktop {
        font-size: 24px;
        padding: 4px;
    }

    /* Scale bar and arrows - slightly smaller */
    .print-elements {
        bottom: 25px;
        left: 25px;
    }

    .scale-bar-new {
        padding: 6px;
        font-size: 11px;
    }

    .north-arrow-new {
        width: 50px;
        height: 50px;
        right: 50px;
    }
}


/* ==========================================================================
   MOBILE LAYOUT (Fixed Map Height 30% + Scrollable Settings 70%)
   ========================================================================== */
@media (max-width: 768px) {
    /* 1. Modal Container: Use a maximum height to respect the viewport boundary */
    .print-modal {
        align-items: flex-end; 
        padding: 0;
    }
    
    .print-container-modal {
        flex-direction: column;
        width: 100%;
        /* CRUCIAL FIX: Limits the modal to the viewport height (approx 95%) */
        max-height: 95vh; 
        border-radius: 24px 24px 0 0;
        background: transparent;
        box-shadow: none;
        overflow: hidden; /* Ensures nothing internal pushes outside */
    }

    /* 2. MAP AREA - FORCE 30% HEIGHT */
    .print-map-area {
        order: 1;
        height: 30vh; /* As requested: 30% of screen height */
        min-height: 200px; /* Safety minimum height */
        flex: 0 0 auto; /* Crucial: Do not shrink or grow this area */
        background: #e5e7eb;
        padding: 0;
        z-index: 1;
    }

    .print-map-wrapper {
        width: 100%;
        height: 100%;
        transform: none; 
        box-shadow: none;
    }

    .print-map-container {
        width: 100% !important;
        height: 100% !important;
    }

    .print-map-header { display: none; } 

    /* 3. SETTINGS SIDEBAR - TAKE REMAINING SPACE */
    .print-sidebar {
        order: 2;
        flex: 1; /* Crucial: Takes all remaining space below the map */
        width: 100%;
        background: #ffffff;
        border-radius: 24px 24px 0 0; 
        box-shadow: 0 -5px 20px rgba(0,0,0,0.1);
        z-index: 10;
        display: flex;
        flex-direction: column;
        overflow: hidden; /* Important for inner scrolling control */
    }

    /* Header: Compact and non-shrinking */
    .print-header {
        padding: 12px 20px;
        min-height: 50px;
        border-bottom: 1px solid #f0f0f0;
        flex-shrink: 0; 
    }
    .print-header h2 { font-size: 16px; }

    /* Content: SCROLLABLE */
    .print-content {
        flex: 1; /* Crucial: Fills all remaining height within the sidebar */
        overflow-y: auto; 
        padding: 15px;
        padding-bottom: 90px; /* Space for the floating print button */
    }

    /* Compact Sections for Mobile */
    .print-section {
        margin-bottom: 15px;
        padding-bottom: 15px;
        border-bottom: 1px solid #f9fafb;
    }
    .print-section:last-child { border-bottom: none; }

    /* Close Button */
    .close-btn-mobile {
        display: block;
        position: absolute;
        top: 12px;
        right: 15px;
        z-index: 50;
        width: 30px; 
        height: 30px;
        background: #f3f4f6;
        border-radius: 50%;
        font-size: 20px;
        color: #374151;
        border: none;
        display: flex; align-items: center; justify-content: center;
    }
    
    .close-btn-desktop { display: none; }

    /* Footer: Fixed at bottom */
    .print-footer {
        position: absolute; 
        bottom: 0; left: 0;
        width: 100%;
        background: white;
        padding: 12px 20px;
        box-shadow: 0 -4px 10px rgba(0,0,0,0.05);
        z-index: 20;
        flex-shrink: 0;
    }
}
