body {
    margin: 0;
    padding: 0;
  }
  
  #map {
    height: 80vh;
  }
  
  #info {
    padding: 10px;
    font-family: sans-serif;
    max-width: 800px;
    margin: 20px;
  }
  
  #captureBtn {
    margin: 10px;
    padding: 8px 12px;
  }
  
  /* Optional: style for code/pre blocks */
  pre {
    background: #f4f4f4;
    padding: 8px;
    overflow: auto;
  }
  
  .grid-control {
    position: absolute;
    top: 10px;
    right: 50px;
    z-index: 1000;
    background: white;
    padding: 15px 20px;
    border-radius: 4px;
    box-shadow: 0 1px 5px rgba(0,0,0,0.2);
    min-width: 300px;
  }
  
  .grid-control label {
    display: block;
    margin-bottom: 10px;
    font-size: 14px;
    font-weight: bold;
  }
  
  .grid-control input[type="range"] {
    width: 100%;
    height: 25px;
    -webkit-appearance: none;
    background: transparent;
  }
  
  /* Styling for Webkit browsers (Chrome, Safari) */
  .grid-control input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 20px;
    width: 20px;
    border-radius: 50%;
    background: #4CAF50;
    cursor: pointer;
    margin-top: -8px;
  }
  
  .grid-control input[type="range"]::-webkit-slider-runnable-track {
    width: 100%;
    height: 4px;
    background: #ddd;
    border-radius: 2px;
  }
  
  /* Styling for Firefox */
  .grid-control input[type="range"]::-moz-range-thumb {
    height: 20px;
    width: 20px;
    border-radius: 50%;
    background: #4CAF50;
    cursor: pointer;
    border: none;
  }
  
  .grid-control input[type="range"]::-moz-range-track {
    width: 100%;
    height: 4px;
    background: #ddd;
    border-radius: 2px;
  }
  
  /* Styling for IE */
  .grid-control input[type="range"]::-ms-thumb {
    height: 20px;
    width: 20px;
    border-radius: 50%;
    background: #4CAF50;
    cursor: pointer;
  }
  
  .grid-control input[type="range"]::-ms-track {
    width: 100%;
    height: 4px;
    background: #ddd;
    border-radius: 2px;
  }
  
  .grid-input-container {
    display: flex;
    align-items: center;
    gap: 15px;
  }
  
  .grid-input-container input[type="range"] {
    flex: 1;
  }
  
  .grid-input-container input[type="number"] {
    width: 80px;
    height: 25px;
    padding: 0 5px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
  }
  
  /* Remove spinner buttons from number input */
  .grid-input-container input[type="number"]::-webkit-inner-spin-button,
  .grid-input-container input[type="number"]::-webkit-outer-spin-button {
    opacity: 1;
  }
  
  .grid-warning {
    margin-top: 10px;
    font-size: 12px;
    padding: 5px;
    border-radius: 3px;
  }
  
  .grid-warning.error {
    background-color: #fff3f3;
    border: 1px solid #ffcdd2;
  }
  
  .output-section {
    margin: 15px 0;
  }
  
  .scrollable-output {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #f8f8f8;
    margin: 5px 0;
  }
  
  .scrollable-output pre {
    margin: 0;
    padding: 10px;
    white-space: pre-wrap;
  }
  
  #info button {
    margin: 5px 0;
    padding: 5px 10px;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
  }
  
  #info button:hover {
    background: #45a049;
  }
  
  .help-btn {
    position: absolute;
    z-index: 1000;
    background: white;
    border: none;
    border-radius: 50%;
    width: 30px;  /* Matched to zoom control size */
    height: 30px; /* Matched to zoom control size */
    box-shadow: 0 1px 5px rgba(0,0,0,0.2);
    cursor: pointer;
    font-size: 16px;
    color: #4CAF50;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .help-btn:hover {
    background: #f8f8f8;
  }
  
  /* Smaller Modal Styling */
  .modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    overflow: hidden; /* Prevent outer scrolling */
  }
  
  .modal-content {
    background-color: #fefefe;
    margin: 10vh auto;
    padding: 15px;
    border: 1px solid #ddd;
    width: 70%;
    max-width: 500px; /* Reduced from 800px */
    max-height: 80vh; /* Reduced from 90vh */
    overflow-y: auto;
    border-radius: 5px;
    position: relative;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  }
  
  /* Ensure close button is always visible */
  .close {
    position: sticky;
    top: 0;
    right: 0;
    float: right;
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1;
    background-color: #fefefe; /* Match modal background */
    padding-left: 10px;
  }
  
  .close:hover,
  .close:focus {
    color: black;
    text-decoration: none;
  }
  
  /* Make the instructions section fit well */
  .instructions {
    margin-top: 20px;
    padding-bottom: 10px; /* Add some padding at bottom for better scrolling */
  }
  
  .instructions h3 {
    color: #333;
    margin-top: 20px;
  }
  
  .instructions ul {
    list-style-type: none;
    padding-left: 0;
  }
  
  .instructions li {
    margin: 10px 0;
    padding: 5px 0;
  }
  
  .instructions i {
    margin-right: 8px;
    color: #4CAF50;
  }
  
  .grid-control select {
    width: 100%;
    padding: 8px 10px;
    margin-bottom: 15px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background-color: white;
    font-size: 14px;
  }
  
  #h3ResolutionContainer {
    margin-top: 10px;
  }
  
  #h3ResolutionContainer select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background-color: white;
    font-size: 14px;
  }
  
  /* Responsive adjustments */
  @media (max-height: 600px) {
    .modal-content {
      margin: 2vh auto; /* Less top margin on small screens */
      max-height: 96vh; /* More height on small screens */
    }
  }
  
  @media (max-width: 768px) {
    .help-grid {
      grid-template-columns: 1fr; /* Single column on small screens */
    }
    
    .modal-content {
      width: 95%; /* Wider on mobile */
      padding: 15px;
    }
  }
  
  .help-section {
    margin-bottom: 15px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
  }
  
  .help-section h3 {
    color: #333;
    font-size: 16px;
    margin-bottom: 10px;
  }
  
  .help-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
  }
  
  .help-item {
    background-color: #f9f9f9;
    border-radius: 4px;
    padding: 10px;
  }
  
  .help-item h4 {
    color: #333;
    margin-top: 0;
    margin-bottom: 8px;
    font-size: 14px;
  }
  
  .help-item p {
    margin: 6px 0;
    line-height: 1.3;
    font-size: 13px;
  }
  
  .compact-list {
    padding-left: 15px;
    margin: 6px 0;
  }
  
  .compact-list li {
    margin: 4px 0;
    line-height: 1.2;
    font-size: 13px;
  }
  