 html,
 body {
     height: 100%;
     width: 100%;
     margin: 0;
     padding: 0;
     font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
     display: flex;
     flex-direction: column;
     overflow: hidden;
     position: static;
 }
 #logo {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 10; /* Ensure it's on top of the map */
 }

 #logo svg {
    width: 50px;
    height: 50px;
 }

 #map {
     height: 100%;
     width: 100%;
     position: static;
     z-index: 1;
     transition: width 0.4s cubic-bezier(0.25, 0.8, 0.25, 1), margin-left 0.4s cubic-bezier(0.25, 0.8, 0.25, 1), height 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
     flex-grow: 1;
 }

 .panel {
     position: absolute;
     bottom: 0;
     left: 0;
     right: 0;
     background-color: #ffffff;
     z-index: 2;
     display: flex;
     flex-direction: column;
 }

 #list-panel {
     flex-shrink: 0;
     /* Prevent panel from shrinking */
     height: 75vh;
     /* Set to open height */
     transform: translateY(100%);
     /* Start hidden */
     visibility: hidden;
     transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1), visibility 0.4s;
     overflow: hidden;
     /* Hide content when collapsed */
     box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.15);
     border-top-left-radius: 16px;
     border-top-right-radius: 16px;
 }

 #list-panel.open {
     transform: translateY(0);
     visibility: visible;
 }

 #list-panel.detail-open {
     transform: scale(0.95);
     border-radius: 16px;
 }

 #list-panel.open .panel-header {
     margin-bottom: 0;
 }

 .panel-header {
     padding: 25px 20px 10px;
     display: flex;
     align-items: center;
     text-align: center;
     cursor: pointer;
     margin-bottom: 45px;
     transition: margin-bottom 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
     position: relative;
 }

 #list-panel .panel-header {
     cursor: grab;
 }

 #detail-panel .panel-header {
     margin-bottom: 0;
 }

 /* --- Detail Panel Layout --- */
 /* Make the header sticky and the content scrollable */
 #detail-panel .panel-header {
    flex-shrink: 0; /* Prevent header from shrinking */
    background-color: #fff; /* Cover content during scroll */
    border-bottom: 1px solid #eee;
 }

 #detail-panel .panel-content {
    overflow-y: auto; /* Override the default overflow:hidden */
    display: block; /* Override display:flex to allow normal block scrolling */
 }
 
 .panel-handle {
     position: absolute;
     top: 10px;
     left: 50%;
     transform: translateX(-50%);
     width: 40px;
     height: 5px;
     background-color: #c0c0c0;
     border-radius: 2.5px;
     margin: 0;
 }

 .panel-title {
     font-size: 1.2rem;
     flex-grow: 1;
     font-weight: 600;
     margin: 0;
 }

 .header-actions {
     position: absolute;
     right: 15px;
     top: calc(50% + 7.5px);
     transform: translateY(-50%);
     display: flex;
     align-items: center;
     gap: 8px;
 }

 .header-action-btn {
     background: none;
     border: none;
     cursor: pointer;
     padding: 5px;
     color: #555;
     line-height: 1;
     position: static;
     display: flex;
     align-items: center;
     justify-content: center;
     /* Was absolute */
 }

 .header-action-text {
     display: none;
 }
 
 #collapse-button {
     display: none;
 }

 #expand-button {
     display: none;
     position: absolute;
     left: 12px;
     z-index: 10;
     align-items: initial;
     cursor: pointer;
     top: 25px;
     z-index: 1;
 }

 .panel-content {
     flex: 1;
     /* Allow content to grow and fill space */
     display: flex;
     flex-direction: column;
     overflow: hidden;
     position: relative;
     /* Prevents content from overflowing the panel */
 }

 #search-container {
    display: flex;
    align-items: center;
    gap: 15px;
     padding: 10px 20px 0;
     position: relative;
     flex-shrink: 0;
     /* padding-top: 0px; */
     margin-bottom: 10px;
 }

 #search-input {
     flex-grow: 1;
     min-width: 0; /* Prevents input from overflowing flex container */
     padding: 10px 15px 10px 40px;
     border: 1px solid #e0e0e0;
     border-radius: 20px;
     font-size: 1rem;
     box-sizing: border-box;
     background-color: #f5f5f5;
     transition: background-color 0.2s, border-color 0.2s;
 }

 #search-input:focus {
     outline: none;
     border-color: #007bff;
     background-color: #fff;
 }

 .search-icon {
     position: absolute;
     left: 35px;
     top: 21px;
     width: 18px;
     height: 18px;
     stroke: #999;
     pointer-events: none;
 }

 .pills-container {
     background-color: #ffffff;
     padding: 5px 20px;
     white-space: nowrap;
     overflow-x: auto;
     -webkit-overflow-scrolling: touch;
     scrollbar-width: none;
     /* For Firefox */
 }

 .pills-container::-webkit-scrollbar {
     display: none;
     /* Hide scrollbar for Chrome, Safari, and Opera */
     height: 8px;
 }

 .pills-container::-webkit-scrollbar-thumb {
     background: #ccc;
     border-radius: 4px;
 }

 .pills-wrapper {
     position: relative;
     flex-shrink: 0;
     /* Prevent wrapper from shrinking in the flex layout */
 }

 .pills-wrapper::before,
 .pills-wrapper::after {
     content: '';
     position: absolute;
     top: 0;
     bottom: 0;
     width: 25px;
     z-index: 2;
     pointer-events: none;
 }

 .pills-wrapper::before {
     left: 0;
     background: linear-gradient(to right, #ffffff 20%, rgba(255, 255, 255, 0));
 }

 .pills-wrapper::after {
     right: 0;
     background: linear-gradient(to left, #ffffff 20%, rgba(255, 255, 255, 0));
 }

 .pill-select-group {
     display: flex;
     flex-wrap: wrap;
     gap: 8px;
     margin-top: 5px;
 }
 
 .pill-select-group .filter-pill {
     margin-right: 0; /* Override default margin from main filter pills */
 }
 
 /* Override for submission form's category container to prevent scrolling
    and allow it to grow to fit all category options. */
 #submission-modal .checkbox-group {
     max-height: none;
     overflow-y: visible;
     border: none;
     padding: 0;
 }
 
 #clear-filters-wrapper {
     flex-shrink: 0;
     /* The wrapper is now just a container, no extra styles needed */
     /* The button inside will have its own margin/padding if needed */
 }

 .filter-pill {
     display: inline-block;
     padding: 6px 14px;
     margin-right: 8px;
     border-radius: 18px;
     background-color: #e9ecef;
     color: #495057;
     cursor: pointer;
     font-weight: 500;
     font-size: 0.9rem;
     transition: background-color 0.2s, color 0.2s;
 }

 .filter-pill:hover {
     background-color: #dee2e6;
 }

 .filter-pill.active {
     background-color: #007bff;
     color: #ffffff;
 }

 #events-container {
     flex-grow: 1;
     overflow-y: auto;
     padding: 0 20px 20px;
     margin-top: 20px;
 }

 /* Custom Scrollbar for Webkit browsers */
 #events-container::-webkit-scrollbar {
     width: 8px;
 }

 #events-container::-webkit-scrollbar-track {
     background: #f1f1f1;
 }

 #events-container::-webkit-scrollbar-thumb {
     background: #888;
     border-radius: 4px;
 }

 #events-container::-webkit-scrollbar-thumb:hover {
     background: #555;
 }

 .card {
     background-color: #f9f9f9;
     border-radius: 8px;
     box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
     overflow: hidden;
     cursor: pointer;
     transition: background-color 0.2s ease;
     margin-bottom: 15px;
     /* Space between cards */
 }

 .card {
     position: relative;
     /* For positioning the favorite button */
 }

 .favorite-btn {
     position: absolute;
     top: 10px;
     right: 10px;
     background-color: rgba(0, 0, 0, 0.4);
     color: white;
     border: none;
     border-radius: 50%;
     width: 36px;
     height: 36px;
     display: flex;
     align-items: center;
     justify-content: center;
     cursor: pointer;
     transition: background-color 0.2s, transform 0.2s;
     z-index: 2;
 }

 .favorite-btn:hover {
     background-color: rgba(0, 0, 0, 0.6);
     transform: scale(1.1);
 }

 .favorite-btn svg {
     width: 20px;
     height: 20px;
 }

 .card:hover {
     background-color: #f0f0f0;
     /* A subtle background color change */
 }

 .card:last-child {
     margin-bottom: 15px;
 }

 .no-results-container {
     text-align: center;
     padding: 40px 20px;
     color: #666;
 }

 .no-results-container p {
     margin-bottom: 20px;
 }

 .clear-filters-btn {
     padding: 10px 20px;
     border: 1px solid #007bff;
     color: #007bff;
     background-color: transparent;
     border-radius: 20px;
     cursor: pointer;
     font-size: 0.9rem;
     font-weight: 600;
     transition: background-color 0.2s, color 0.2s;
 }

 .clear-filters-btn:hover {
     background-color: #007bff;
     color: #fff;
 }

 .address-link {
     color: #007bff;
     text-decoration: none;
 }

 .address-link:hover {
     text-decoration: underline;
 }

 .detail-actions {
     margin-top: 20px;
     padding-top: 15px;
     border-top: 1px solid #eee;
     display: flex;
     justify-content: center;
     gap: 10px;
 }

 #add-to-calendar-btn {
     display: inline-flex;
     align-items: center;
     gap: 8px;
     padding: 10px 20px;
     border: 1px solid #28a745;
     color: #28a745;
     background-color: transparent;
     border-radius: 20px;
     cursor: pointer;
     font-size: 0.9rem;
     font-weight: 600;
     transition: background-color 0.2s, color 0.2s;
 }

 #add-to-calendar-btn:hover {
     background-color: #28a745;
     color: #fff;
 }

 #share-event-btn {
     display: inline-flex;
     align-items: center;
     gap: 8px;
     padding: 10px 20px;
     border: 1px solid #007bff;
     color: #007bff;
     background-color: transparent;
     border-radius: 20px;
     cursor: pointer;
     font-size: 0.9rem;
     font-weight: 600;
     transition: background-color 0.2s, color 0.2s;
 }

 #share-event-btn:hover {
     background-color: #007bff;
     color: #fff;
 }

 #share-event-btn:disabled {
     background-color: #28a745;
     border-color: #28a745;
     color: #fff;
     cursor: default;
 }

 #report-event-btn {
     display: inline-flex;
     align-items: center;
     gap: 8px;
     padding: 10px 20px;
     border: 1px solid #dc3545;
     color: #dc3545;
     background-color: transparent;
     border-radius: 20px;
     cursor: pointer;
     font-size: 0.9rem;
     font-weight: 600;
     transition: background-color 0.2s, color 0.2s;
 }

 #report-event-btn:hover {
     background-color: #dc3545;
     color: #fff;
 }

 .settings-content {
    margin: 20px 0;
 }

.settings-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid #eee;
}

.settings-item:first-of-type {
    border-top: 1px solid #eee;
}

.settings-item > label {
    font-weight: 500;
    color: #333;
}

.segmented-control {
    display: flex;
    border: 1px solid #007bff;
    border-radius: 8px;
    overflow: hidden;
}

.segmented-control input[type="radio"] {
    display: none;
}

.segmented-control label {
    padding: 6px 16px;
    cursor: pointer;
    background-color: #fff;
    color: #007bff;
    transition: background-color 0.2s, color 0.2s;
    font-weight: 500;
    font-size: 0.9rem;
}

.segmented-control input[type="radio"]:checked + label {
    background-color: #007bff;
    color: #fff;
}

.segmented-control label:not(:last-of-type) {
    border-right: 1px solid #007bff;
}

.zoom-control {
    display: flex;
    align-items: center;
    gap: 15px;
}

.zoom-control input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 120px;
    height: 8px;
    background: #ddd;
    border-radius: 5px;
    outline: none;
    transition: background .2s;
}

.zoom-control input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: #007bff;
    cursor: pointer;
    border-radius: 50%;
}

.zoom-control input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: #007bff;
    cursor: pointer;
    border-radius: 50%;
    border: none;
}

.zoom-control #zoom-level-value {
    font-weight: 500;
    min-width: 20px;
    text-align: center;
}

/* Modern Toggle Switch */
 .toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
 }

 .toggle-switch-checkbox {
    opacity: 0;
    width: 0;
    height: 0;
 }

 .toggle-switch-label {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 28px;
 }

 .toggle-switch-label:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
 }

 .toggle-switch-checkbox:checked + .toggle-switch-label {
    background-color: #007bff;
 }

 .toggle-switch-checkbox:checked + .toggle-switch-label:before {
    transform: translateX(22px);
 }

 .address-container {
     display: flex;
     align-items: center;
     justify-content: space-between;
     gap: 10px;
     margin: 1em 0;
 }

 .address-container p {
     margin: 0;
 }

 .directions-btn {
     background: none;
     border: 1px solid #ccc;
     border-radius: 50%;
     width: 36px;
     height: 36px;
     display: flex;
     align-items: center;
     justify-content: center;
     cursor: pointer;
     padding: 0;
     flex-shrink: 0;
     transition: background-color 0.2s, border-color 0.2s;
 }

 .directions-btn svg {
     stroke: #555;
     width: 18px;
     height: 18px;
 }

 .directions-btn:hover {
     background-color: #f0f0f0;
     border-color: #aaa;
 }

 #event-photo {
     display: none;
 }

 /* Fix for photo upload group overflowing on smaller screens.
    This ensures the container is constrained by the modal's width. */
 #photo-upload-group {
    width: 100%;
 }

 #scroll-to-top-btn {
     position: absolute;
     bottom: 20px;
     right: 30px;
     width: 44px;
     height: 44px;
     background-color: #007bff;
     color: white;
     border: none;
     border-radius: 50%;
     display: flex;
     align-items: center;
     justify-content: center;
     cursor: pointer;
     box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
     z-index: 5;
     opacity: 0;
     visibility: hidden;
     transform: translateY(20px);
     transition: opacity 0.3s, visibility 0.3s, transform 0.3s;
 }

 #scroll-to-top-btn.visible {
     opacity: 1;
     visibility: visible;
     transform: translateY(0);
 }

 .card-chevron {
     display: none;
     color: #aaa;
     transition: color 0.2s ease;
     margin-left: 10px;
 }

 .card:hover .card-chevron {
     color: #333;
 }

 .card-content {
     padding: 15px 0;
     flex-grow: 1;
 }

 .card-body {
     display: flex;
     align-items: center;
     padding: 0 15px;
 }

 .card-title {
     font-size: 1.1rem;
     font-weight: 600;
     margin: 0 0 5px;
 }

 .card-description {
     font-size: 0.9rem;
     color: #666;
     margin-bottom: 10px;
     /* Add space before pills */
 }

 .mini-pills-container {
     display: flex;
     flex-wrap: wrap;
     gap: 6px;
 }

 .mini-pill {
     display: inline-block;
     padding: 4px 10px;
     border-radius: 12px;
     background-color: #e0e0e0;
     color: #333;
     font-size: 0.75rem;
     font-weight: 500;
 }

 .sale-type-pill-mini {
     background-color: #28a745;
     /* A green color for sale type */
     color: white;
 }

 #detail-panel {
     height: 80vh;
     /* Changed from 100vh */
     z-index: 3;
     transform: translateY(100%);
     /* Move completely out of view */
     visibility: hidden;
     /* Hide when closed */
     box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.15);
     border-top-left-radius: 16px;
     border-top-right-radius: 16px;
     transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1), visibility 0.4s;
 }

 #detail-panel.open {
     transform: translateY(0);
     visibility: visible;
     /* Show when open */
 }

 #detail-back-button {
     display: none;
     cursor: pointer;
     /* Reset button styles */
     background: none;
     border: none;
     padding: 0;
     margin-right: 10px;
 }

 #detail-favorite-btn {
     position: static;
     background-color: transparent;
     margin-left: 10px;
     padding: 5px;
 }

 #detail-favorite-btn svg {
     stroke: #666;
 }

 .favorite-btn.active svg,
 #detail-favorite-btn.active svg {
     fill: #ff4757;
     stroke: #ff4757;
 }

 #detail-content {
     padding: 20px;
     overflow-y: scroll;
     padding-top: 0px;
 }

 #qr-code-container {
     position: absolute;
     bottom: 70px;
     /* Positioned just above the collapsed panel */
     left: 20px;
     z-index: 10;
     cursor: pointer;
     transition: opacity 0.3s ease;
 }

 #qr-code-container img {
     width: 50px;
     height: 50px;
     border-radius: 5px;
     box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
 }

 #qr-modal {
     position: fixed;
     top: 0;
     left: 0;
     width: 100%;
     height: 100%;
     background-color: rgba(0, 0, 0, 0.6);
     z-index: 11;
     display: none;
     /* Hidden by default */
     justify-content: center;
     align-items: center;
     flex-direction: column;
 }

 #qr-modal img {
     width: 250px;
     height: 250px;
 }

 #qr-modal p {
     color: white;
     font-size: 1.2rem;
     margin-top: 20px;
 }

 #debug-overlay {
     position: absolute;
     top: 10px;
     left: 50%;
     transform: translateX(-50%);
     background-color: rgba(0, 0, 0, 0.7);
     color: white;
     border-radius: 5px;
     z-index: 12;
     font-family: monospace;
     font-size: 12px;
     pointer-events: auto;
     box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
 }

 #debug-header {
     padding: 5px 10px;
     background-color: rgba(0, 0, 0, 0.9);
     cursor: pointer;
     font-weight: bold;
     user-select: none;
     /* Prevent text selection on drag */
 }

 #debug-content {
     padding: 10px;
     pointer-events: auto;
     /* Allow scrolling/selection */
     min-width: 350px;
     max-height: 400px;
     overflow-y: auto;
 }

 #debug-overlay.collapsed #debug-content {
     display: none;
 }

 #loading-overlay {
     position: fixed;
     top: 0;
     left: 0;
     width: 100%;
     height: 100%;
     background-color: rgba(255, 255, 255, 0.9);
     z-index: 9999;
     display: flex;
     justify-content: center;
     align-items: center;
     transition: opacity 0.5s ease, visibility 0.5s;
     opacity: 1;
     visibility: visible;
 }

 #loading-overlay.hidden {
     opacity: 0;
     visibility: hidden;
 }

 .spinner {
     width: 50px;
     height: 50px;
     border: 5px solid #f3f3f3;
     border-top: 5px solid #007bff;
     border-radius: 50%;
     animation: spin 1s linear infinite;
 }

 /* --- Image Slider --- */
 .image-slider {
     position: relative;
     overflow: hidden;
     background-color: #f0f0f0;
     /* Placeholder color */
 }

 .card-slider {
     height: 150px;
 }

 .detail-slider {
     height: 250px;
     /* A bit taller for the detail view */
     border-radius: 8px;
     margin-bottom: 15px;
 }

 .slider-inner {
     display: flex;
     height: 100%;
     transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
 }

 .slider-slide {
     flex-shrink: 0;
     width: 100%;
     height: 100%;
     background-size: cover;
     background-position: center;
     background-repeat: no-repeat;
 }

 .slider-btn {
     position: absolute;
     top: 50%;
     transform: translateY(-50%);
     background-color: rgba(0, 0, 0, 0.5);
     color: white;
     border: none;
     border-radius: 50%;
     width: 32px;
     height: 32px;
     font-size: 18px;
     font-weight: bold;
     cursor: pointer;
     display: flex;
     align-items: center;
     justify-content: center;
     line-height: 1;
     transition: background-color 0.2s, opacity 0.3s;
     opacity: 0;
     /* Hidden by default */
     z-index: 1;
 }

 .image-slider:hover .slider-btn {
     opacity: 1;
     /* Show on hover */
 }

 .slider-btn.prev {
     left: 10px;
 }

 /* Hide on mobile */
 @media (max-width: 768px) {
     #qr-code-container {
         display: none;
     }
 
     #submission-modal .modal-content {
         width: 100%;
         height: 100%;
         max-height: 100%;
         border-radius: 0;
         /* Ensure the modal takes full width on mobile */
         max-width: 100%; 
         /* Ensure the flexbox layout works by preventing the main container from scrolling */
         overflow: hidden;
         /* The new layout class handles the flexbox setup */
     }
 
     /* Mobile-specific padding adjustments */
     #submission-modal .modal-content--layout-flex > h2 {
         padding: 20px;
         font-size: 1.2rem;
         text-align: center;
     }
 
     #submission-modal .modal-content--layout-flex .form-scroll-content {
         padding: 20px;
     }
 
     #submission-modal .modal-content--layout-flex .form-actions {
         padding: 15px 20px;
     }

     /* Hide original header actions and show bottom nav */
     #list-panel .header-actions {
        display: none;
     }
     body {
        padding-bottom: 65px; /* Height of the nav bar */
     }
 }

 .slider-btn.next {
     right: 10px;
 }

 .slider-btn:hover {
     background-color: rgba(0, 0, 0, 0.8);
 }

 .slider-dots {
     position: absolute;
     bottom: 10px;
     left: 50%;
     transform: translateX(-50%);
     display: flex;
     gap: 6px;
     z-index: 1;
 }

 .slider-dot {
     width: 8px;
     height: 8px;
     border-radius: 50%;
     background-color: rgba(255, 255, 255, 0.6);
     border: 1px solid rgba(0, 0, 0, 0.2);
     cursor: pointer;
     transition: background-color 0.2s;
 }

 .slider-dot.active {
     background-color: #ffffff;
 }

 .user-location-dot {
     width: 12px;
     height: 12px;
     border-radius: 50%;
     background-color: #007aff;
     border: 3px solid #fff;
     box-shadow: 0 0 0 2px rgba(0, 122, 255, 0.3);
     transform: translate(-50%, -50%);
     animation: pulse 2s infinite;
 }

 @keyframes spin {
     0% {
         transform: rotate(0deg);
     }

     100% {
         transform: rotate(360deg);
     }
 }

 @keyframes pulse {
     0% {
         box-shadow: 0 0 0 0 rgba(0, 122, 255, 0.4);
     }

     70% {
         box-shadow: 0 0 0 20px rgba(0, 122, 255, 0);
     }

     100% {
         box-shadow: 0 0 0 0 rgba(0, 122, 255, 0);
     }
 }

 /* --- Bottom Navigation Bar --- */
 #bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background-color: #ffffff;
    border-top: 1px solid #e0e0e0;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.08); 
    justify-content: space-around;
    display: flex; /* Display by default for mobile-first. */
    align-items: stretch; /* Make buttons fill the height */
    z-index: 999;
 }

 .nav-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    background: none;
    border: none;
    padding: 5px 0;
    cursor: pointer;
    color: #666;
    transition: color 0.2s, transform 0.1s ease-out;
 }

 /* Add a subtle "tap" animation when a nav button is pressed. */
 .nav-btn:active {
    transform: scale(0.92);
    /* Make the press-down feel faster and more responsive. */
    transition-duration: 0.05s;
 }

 .nav-btn svg {
   width: 24px;
   height: 24px;
   /* Default to stroked icons, which is the most common case. */
   stroke: currentColor;
   fill: none;
 }

 .nav-btn-text {
    font-size: 0.7rem;
    font-weight: 500;
 }

 .nav-btn.active {
    color: #007bff;
    transform: translateY(-2px); /* Pop the active icon up slightly */
 }

 .nav-btn.active .nav-btn-text {
    font-weight: 700; /* Make the text bolder for emphasis */
 }

 /* --- Cluster Info Window --- */
 .cluster-info-window {
     font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
     padding: 5px;
     max-width: 250px;
 }
 
 .cluster-info-window strong {
     font-size: 1rem;
     color: #333;
     display: block;
     margin-bottom: 8px;
     border-bottom: 1px solid #eee;
     padding-bottom: 5px;
 }
 
 .cluster-info-list {
     list-style: none;
     padding: 0;
     margin: 0;
     max-height: 150px;
     overflow-y: auto;
 }
 
 .cluster-info-list li {
     font-size: 0.9rem;
     color: #555;
     padding: 4px 0;
     white-space: nowrap;
     overflow: hidden;
     text-overflow: ellipsis;
 }
 
 .cluster-info-more {
     font-style: italic;
     color: #666;
     margin: 5px 0 0;
     font-size: 0.8rem;
 }
 
 @keyframes infowindow-fade-in {
     from {
         opacity: 0;
         transform: translateY(5px);
     }
     to {
         opacity: 1;
         transform: translateY(0);
     }
 }
 
 .infowindow-fade-animation {
     animation: infowindow-fade-in 0.25s ease-out;
 }

 /* --- Google Maps Overrides --- */
 /*
  * Selectively hide the close button on the InfoWindow for cluster previews.
  * We use the :has() pseudo-class to apply this style only when the InfoWindow
  * contains our custom .cluster-info-window content.
  */
 .gm-style-iw-c:has(.cluster-info-window) button[aria-label="Close"] {
    display: none !important;
 }
 #center-location-button {
     position: absolute;
     top: 16px;
     right: 10px;
     z-index: 10;
 }

 @media (min-width: 769px) {
  #logo {
      right: 10px;
      left: auto;
     background-color: #fff;
     border-radius: 50%;
     width: 40px;
     height: 40px;
     display: flex;
     justify-content: center;
     align-items: center;
     cursor: pointer;
     box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
 }

 #center-location-button svg {
     stroke: #555;
 }

 /* Override for the few icons that should be filled instead of stroked. */
 .nav-btn svg[fill="currentColor"] {
    stroke: none;
    fill: currentColor;
 }

 #center-location-button.following svg {
     stroke: #007bff;
     /* Active blue */
     fill: #e6f2ff;
 }

 /* Desktop Layout */
 @media (min-width: 769px) {
     #bottom-nav {
         display: none;
     }

     .card-chevron {
         display: block;
     }

     #detail-back-button {
         display: flex;
         align-items: center;
     }

     #debug-header {
         cursor: move;
     }

     #map {
         /* width: 75%;
         margin-left: 25%; */
     }

     #map.panel-closed {
         width: 100%;
         margin-left: 0;
     }

     .panel {
         top: 0;
         bottom: 0;
         left: 0;
         right: auto;
         width: 25%;
         height: 100%;
         border-radius: 0;
         box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
         position: fixed;
         border-radius: 0px;
     }

     #list-panel {
         position: fixed;
         height: 100%;
         transform: translateX(0);
         transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1), opacity 0.4s ease;
         visibility: visible; /* Ensure it's visible on desktop */     
         border-top-left-radius: 0px;
         border-top-right-radius: 0px;
     }

     #list-panel.closed {
         transform: translateX(-100%);
         opacity: 0;
     }

     #list-panel.detail-open {
         transform: translateX(0);
         /* Stays visible */
     }

     #detail-panel {
         height: 100%;
         width: 25%;
         transform: translateX(-100%);
         z-index: 4;
         /* Ensure detail is on top */
     }

     #detail-panel.open {
         transform: translateX(0);
     }

     .panel-header {
         display: flex;
         align-items: center;
         cursor: default;
         /* No dragging on desktop */
         margin-bottom: 0;
         padding: 10px 20px;
         border-radius: 0px;
     }

     #collapse-button {
         display: flex; /* Use flex to align with other buttons */
         /* Minor visual adjustment to perfectly align with the other icons. */
         transform: translateY(1px);
     }

     #list-panel.closed+#expand-button {
         display: block;
     }

     .panel-handle {
         display: none;
         /* Hide mobile handle */
     }

     #qr-code-container {
         bottom: 20px;
         left: auto;
         right: 20px;
     }

     .panel-header {
         text-align: left;
         /* Override mobile-first center alignment */
     }

     .panel-title {
         flex-grow: 1;
     }

     .header-actions {
         position: static;
         transform: none;
         gap: 0;
     }

     .header-action-btn {
         position: static;
         margin-left: 10px;
     }

     #detail-back-button {
         background: none;
         border: none;
         padding: 0;
         /* Reset button styles */
     }

     #submission-modal .modal-content {
         max-width: 1000px;
     }
 }