/* potaMapStyles.css */

/* Ensure overlay panes never block marker taps */
.leaflet-pane.searchHighlightPane,
#pqlOverlayPane, #searchHighlightPane,
#pqlOverlayPane *, #searchHighlightPane * {
    pointer-events: none !important;
}

/* Indicator while mode data updates */
#mode-loading {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.85em;
    z-index: 1000;
    display: none;
    pointer-events: none; /* allow map interaction beneath indicator */
}

/* ================= Pulsing markers ================= */

/* Highlight used when "Go To Park" centers a search result */
.goto-park-highlight {
    /* Ensure search highlights never intercept taps/clicks */
    pointer-events: none !important;
}

/* Pane that holds search highlight markers should never block interaction */
.leaflet-pane.searchHighlightPane {
    pointer-events: none;
}

/* Purple highlight for newly added parks */
.pulse-marker {
    pointer-events: none;
    width: 20px;
    height: 20px;
    background-color: #800080 !important;
    border-radius: 50%;
    border: 2px solid black;
    box-shadow: 0 0 8px rgba(128, 0, 128, 0.7) !important;
    opacity: 1;
    z-index: 1000;
    transform: translate(-10px, -10px);
    animation: pulse-ring 2.5s ease-out infinite;
    -webkit-animation: pulse-ring 2.5s ease-out infinite;
}

@keyframes pulse-ring {
    0%   { box-shadow: 0 0 0 0 rgba(128, 0, 128, 0.5); }
    70%  { box-shadow: 0 0 0 15px rgba(128, 0, 128, 0); }
    100% { box-shadow: 0 0 0 0 rgba(128, 0, 128, 0); }
}
@-webkit-keyframes pulse-ring {
    0%   { box-shadow: 0 0 0 0 rgba(128, 0, 128, 0.5); }
    70%  { box-shadow: 0 0 0 15px rgba(128, 0, 128, 0); }
    100% { box-shadow: 0 0 0 0 rgba(128, 0, 128, 0); }
}

.active-pulse-marker {
    pointer-events: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid black;
    opacity: 1;
    z-index: 1001;
    transform: translate(-10px, -10px);
    background-color: rgb(var(--pulse-shadow-color, 0, 187, 255));
    box-shadow: 0 0 8px rgba(var(--pulse-shadow-color, 0, 187, 255), 0.7);
    animation: pulse-ring-live 1.8s ease-out infinite;
    -webkit-animation: pulse-ring-live 1.8s ease-out infinite;
}

/* Darker shadow tones for better visibility */
.active-pulse-marker.mode-cw   { --pulse-shadow-color: 0, 160, 0;    } /* dark green */
.active-pulse-marker.mode-ssb  { --pulse-shadow-color: 230, 185, 0;  } /* dark goldenrod */
.active-pulse-marker.mode-data { --pulse-shadow-color: 255, 102, 102;} /* light red */

/* First activation: dark blue theme even when on-air */
.active-pulse-marker.first-activation { --pulse-shadow-color: 0, 26, 102; }

@keyframes pulse-ring-live {
    0%   { box-shadow: 0 0 0 0 rgba(var(--pulse-shadow-color, 0, 187, 255), 0.9); }
    70%  { box-shadow: 0 0 0 20px rgba(var(--pulse-shadow-color, 0, 187, 255), 0); }
    100% { box-shadow: 0 0 0 0 rgba(var(--pulse-shadow-color, 0, 187, 255), 0); }
}
@-webkit-keyframes pulse-ring-live {
    0%   { box-shadow: 0 0 0 0 rgba(var(--pulse-shadow-color, 0, 187, 255), 0.9); }
    70%  { box-shadow: 0 0 0 20px rgba(var(--pulse-shadow-color, 0, 187, 255), 0); }
    100% { box-shadow: 0 0 0 0 rgba(var(--pulse-shadow-color, 0, 187, 255), 0); }
}

/* Disable pulsing entirely in desktop-mode */
.desktop-mode .pulse-marker,
.desktop-mode .active-pulse-marker {
    pointer-events: none;
    animation: none !important;
    -webkit-animation: none !important;
}

/* Ensure interactive park markers remain tappable even when pulsing */
.leaflet-marker-icon.park-spot-icon {
    pointer-events: auto;
    touch-action: manipulation;
    cursor: pointer;
}

.leaflet-marker-icon.park-spot-icon.pulse-marker,
.leaflet-marker-icon.park-spot-icon.active-pulse-marker {
    pointer-events: auto;
}

.desktop-mode .leaflet-marker-icon.park-spot-icon.pulse-marker,
.desktop-mode .leaflet-marker-icon.park-spot-icon.active-pulse-marker {
    pointer-events: auto;
}

/* Ensure PQL highlight pulses render behind standard markers */
.pql-pulse-icon {
    pointer-events: none;
    z-index: -1000;
}
/* Desktop mode: shrink mode filter dots by ~20% */
.desktop-mode .mode-dot {
    width: 28px;   /* was 34px */
    height: 28px;
}

.desktop-mode .mode-dot svg {
    width: 18px;   /* was 22px */
    height: 18px;
}

.desktop-mode .mode-dot circle {
    cx: 11;
    cy: 11;
    r: 8.6;
}

/* Save PQL Search button styling */
#savePqlSearch {
    display: block;
    width: 100%;
    padding: 10px;
    font-size: 16px;
    color: #fff;
    background-color: #336633;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-align: center;
    transition: background-color 0.3s ease, transform 0.2s ease;
    margin-top: 10px;
}
#savePqlSearch:hover:not(:disabled) {
    background-color: #264d26;
    transform: scale(1.02);
}
#savePqlSearch:active:not(:disabled) {
    transform: scale(0.98);
}
#savePqlSearch:disabled {
    background-color: #cccccc;
    color: #666666;
    cursor: not-allowed;
    transform: none;
}
/* ================= General layout ================= */

#menu {
    display: flex;
    flex-direction: column;
}
#menu li {
    display: block;
    width: 100%;
    box-sizing: border-box;
}
#callsignDisplay {
    word-break: break-word;
    max-width: 100%;
}

/* Collapsible panels in hamburger menu */
.menu-panel, .menu-subpanel {
    border:1px solid rgba(0,0,0,0.12);
    border-radius:8px;
    background:#fff;
    margin:8px 0;
}

.menu-panel > summary, .menu-subpanel > summary {
    list-style: none;
    cursor: pointer;
    font-weight: 600;
    padding: 8px;
    background-color: #336633;
    color: #fff;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    text-align: center;
    border-radius: 8px;
}

.menu-panel[open] > summary, .menu-subpanel[open] > summary {
    border-bottom: 1px solid rgba(0,0,0,0.12);
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.menu-panel .panel-content, .menu-subpanel .panel-content {
    padding:8px;
}

.menu-panel > summary::marker,
.menu-subpanel > summary::marker,
.menu-panel > summary::-webkit-details-marker,
.menu-subpanel > summary::-webkit-details-marker {
    color: #fff;
}

/* Tooltips */
.custom-tooltip {
    font-size: 0.85em;
    font-weight: 500;
    background-color: rgba(255, 255, 255, 0.85);
    color: #000;
    padding: 4px 6px;
    border-radius: 4px;
}
.desktop-mode .custom-tooltip,
.desktop-mode .leaflet-tooltip {
    display: none !important;
}

/* ================= Filters panel & chips ================= */
/* ================= Filters panel & chips (mobile-first) ================= */

:root{
    --chip-bg: #f8fafc;
    --chip-bg-hover: #eef2f7;
    --chip-border: #cbd5e1;
    --chip-fg: #0f172a;

    --chip-active-bg: #14532d;   /* deep green */
    --chip-active-fg: #ffffff;
    --chip-active-border: #14532d;
}

.filters-panel {
    padding: 12px;
    border: 1px solid rgba(0,0,0,0.12);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    -webkit-tap-highlight-color: transparent;
}

.filters-title {
    font-weight: 300;
    margin-bottom: 10px;
}

/* Grid: 1 col on phones, 2 on larger (iPad width and up) */
.filters-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

@media (min-width: 700px) { /* iPad portrait+ */
    .filters-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Chip buttons */
.filter-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;             /* Apple HIG target */
    padding: 10px 14px;
    border: 1px solid var(--chip-border);
    border-radius: 10px;
    background: var(--chip-bg);
    color: var(--chip-fg);
    font-size: 15px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    -webkit-appearance: none;     /* iOS button reset */
    transition: background .15s ease, border-color .15s ease, color .15s ease, transform .02s ease;
}

/* Hover/pressed (desktop & iPad with pointer) */
.filter-chip:hover { background: var(--chip-bg-hover); }
.filter-chip:active { transform: scale(0.995); }

/* Focus ring for keyboard / VO */
.filter-chip:focus-visible {
    outline: 2px solid #2563eb;   /* blue ring */
    outline-offset: 2px;
    border-color: #2563eb;
}

/* Selected state – handle both a class and ARIA for robustness */
.filters-panel .filter-chip.active,
.filters-panel .filter-chip[aria-pressed="true"] {
    background: var(--chip-active-bg);
    color: var(--chip-active-fg);
    border-color: var(--chip-active-border);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
}

/* Inline threshold input inside a chip */
.filter-chip .threshold-inline-input {
    display: none;
    width: 3.2ch;
    height: 26px;
    margin-left: 8px;
    padding: 0 6px;
    border: 1px solid rgba(0,0,0,0.25);
    border-radius: 6px;
    background: rgba(255,255,255,0.85);
    color: inherit;
    font: inherit;
    font-weight: 700;
    text-align: center;
    line-height: 26px;
    -webkit-appearance: none;
}

/* Show input only when active/pressed; improve contrast on dark bg */
.filters-panel .filter-chip.active .threshold-inline-input,
.filters-panel .filter-chip[aria-pressed="true"] .threshold-inline-input {
    display: inline-block;
    border-color: rgba(255,255,255,0.6);
}

/* Remove iOS number spinners and quirks */
.threshold-inline-input::-webkit-outer-spin-button,
.threshold-inline-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.threshold-inline-input { -moz-appearance: textfield; }

/* Small phones tighten paddings a touch */
@media (max-width: 380px) {
    .filter-chip { padding: 9px 12px; font-size: 14px; }
}

/* ================= Mode filter panel ================= */
/* Panel container stays the same */
.mode-filter-panel{
    padding: 8px 10px 6px;
    margin-top: 8px;
    margin-bottom: 6px;
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 1px 6px rgba(0,0,0,0.04);
}

/* Dots row and labels: same 5-column grid for perfect alignment */
.mode-dots-row{
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    justify-items: center;
    align-items: center;
    width: 100%;
    margin-bottom: 4px;
}
.mode-dots-labels{
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    justify-items: center;
    width: 100%;
    font-size: 12px;
    line-height: 1.1;
    margin-top: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}
.mode-filter-row {
    display: flex;
    gap: 8px;
    justify-content: space-around;
    width: 100%;
}
.mode-filter-row button {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
}
.mode-filter-row button:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}
.mode-filter-labels {
    display: flex;
    justify-content: space-around;
    width: 100%;
    font-size: 0.8em;
    margin-top: 4px;
}
.mode-filter-btn.off .pulse-marker,
.mode-filter-btn.off .active-pulse-marker {
    pointer-events: none;
    filter: grayscale(100%) brightness(40%);
}

/* Hide any legacy switches still in DOM */
#menu .switch,
#menu .switch-label { display: none !important; }

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
    .filter-chip { transition: none; }
}

/* Make the button itself invisible so only the circle shows */
.mode-dot{
    width: 34px; height: 34px;          /* tap target */
    display: grid; place-items: center;  /* center the SVG */
    padding: 0; margin: 0;

    background: transparent !important;  /* kill UA backgrounds */
    border: 0 !important;                /* no border box */
    border-radius: 0 !important;         /* no rounded rect */
    box-shadow: none !important;
    appearance: none; -webkit-appearance: none;
    -webkit-tap-highlight-color: transparent;
    cursor: pointer;
}



/* Colors per mode */
.mode-dot.dot-new  { --dot-color: #800080; }
.mode-dot.dot-data { --dot-color: #ff6666; }
.mode-dot.dot-cw   { --dot-color: #008000; }
.mode-dot.dot-ssb  { --dot-color: #cc9900; }
.mode-dot.dot-unk  { --dot-color: #1e90ff; }

/* Dim state */
.mode-dot.off circle{ filter: grayscale(100%) brightness(45%); }


.mode-dot svg{ width: 22px; height: 22px; display: block; }
.mode-dot circle{
    cx: 11; cy: 11; r: 9;
    stroke: #111; stroke-width: 2;
    fill: var(--dot-color, #000);        /* color lives on the circle */
}

.mode-dot:focus-visible{
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

/* Highlight parks that have PN&R reviews */
.leaflet-marker-icon.has-review {
    box-shadow: 0 0 0 1.5px rgba(255, 215, 0, 0.95), 0 0 0 2.5px rgba(0, 0, 0, 0.9);
    border-radius: 50%;
}

/* colors */
.dot-new  { background: #800080; }             /* purple */
.dot-data { background: #ff6666; }             /* red-ish */
.dot-cw   { background: #008000; }             /* green */
.dot-ssb  { background: #cc9900; }             /* yellow/goldenrod */
.dot-unk  { background: #1e90ff; }             /* blue */

/* "off" = dimmed */
.mode-dot.off{
    filter: grayscale(100%) brightness(45%);
}


/* Small phones */
@media (max-width: 360px){
    .mode-dot{ width: 24px; height: 24px; }
    .mode-dot svg{ width: 16px; height: 16px; }
}

/* Ensure Leaflet popups fit and wrap on small screens */
.leaflet-popup-content-wrapper{
    max-width: 280px;
}

.leaflet-popup-content{
    overflow-wrap: break-word;
}

@media (max-width: 540px) {
    .leaflet-popup-content-wrapper {
        max-width: min(360px, calc(100vw - 24px));
        border-radius: 14px;
    }

    .leaflet-popup-content {
        padding: 10px 12px 12px;
    }

    .leaflet-popup-tip-container {
        width: 100%;
        display: flex;
        justify-content: center;
    }

    .leaflet-popup-tip {
        margin: 0 auto;
    }
}

/* Flip card popup for personal park notes */
.leaflet-popup-content .park-popup-card {
    position: relative;
    perspective: 1400px;
    -webkit-perspective: 1400px;
    min-height: 0;
}

.park-popup-inner {
    position: relative;
    width: 100%;
    display: grid;
    transition: transform 0.48s ease;
    transform-style: preserve-3d;
    -webkit-transform-style: preserve-3d;
    transform: rotateY(0deg);
    -webkit-transform: rotateY(0deg);
}

.park-popup-card.is-flipped .park-popup-inner {
    transform: rotateY(180deg);
    -webkit-transform: rotateY(180deg);
}

.park-popup-face {
    position: relative;
    grid-area: 1 / 1 / 2 / 2;
    background: #fff;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    min-height: 0;
    padding-top: 10px;
}

.park-popup-front-body,
.park-popup-back-body {
    padding: 0 4px 6px;
    min-height: 0;
}

.park-popup-back-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    padding: 4px 16px 12px;
}
/* Reserve space so the title never sits under the dog-ear */
.park-popup-front-body {
    padding-left: 28px;
}
.park-popup-face.park-popup-back {
    transform: rotateY(180deg);
    -webkit-transform: rotateY(180deg);
}

.park-popup-card.no-3d .park-popup-inner {
    display: block;
    transform: none;
    -webkit-transform: none;
}

.park-popup-card.no-3d .park-popup-face {
    transform: none;
    -webkit-transform: none;
    backface-visibility: visible;
    -webkit-backface-visibility: visible;
}

.park-popup-card.no-3d .park-popup-back {
    display: none;
}

.park-popup-card.no-3d.is-flipped .park-popup-front {
    display: none;
}

.park-popup-card.no-3d.is-flipped .park-popup-back {
    display: block;
}

.park-popup-corner-toggle {
    position: absolute;
    top: -12px;
    left: -12px;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    border: 1px solid rgba(15, 23, 42, 0.35);
    background: rgba(255, 255, 255, 0.96);
    color: #0f172a;
    cursor: pointer;
    box-shadow: 0 6px 12px rgba(15, 23, 42, 0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.16s ease, box-shadow 0.24s ease, background-color 0.24s ease;
    z-index: 3;
    padding: 0;
}

.park-popup-corner-toggle .park-popup-corner-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 0.85rem;
    font-weight: 700;
    line-height: 1;
    color: inherit;
}

.park-popup-corner-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.26);
}

.park-popup-corner-toggle:hover,
.park-popup-corner-toggle:focus-visible {
    background: #ffffff;
}

.park-popup-corner-toggle:focus-visible {
    outline: 2px solid #facc15;
    outline-offset: 3px;
}

.park-popup-card.has-note .park-popup-corner-toggle.front {
    border-color: rgba(4, 120, 87, 0.7);
    box-shadow: 0 8px 18px rgba(4, 120, 87, 0.28);
}

.park-popup-card .park-popup-corner-toggle.back {
    display: none;
}

.park-popup-card.is-flipped .park-popup-corner-toggle.front {
    display: none;
}

.park-popup-card.is-flipped .park-popup-corner-toggle.back {
    display: flex;
}

/* Compact dog-ear for narrow popups */
.compact-note .park-popup-corner-toggle {
    top: -10px;
    left: -10px;
    width: 24px;
    height: 24px;
}

.compact-note .park-popup-corner-toggle .park-popup-corner-icon {
    font-size: 0.75rem;
}

.park-popup-notes-container {
    width: 100%;
    max-width: 360px;
    margin: 4px auto 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
}

.park-popup-notes-display {
    width: 100%;
    box-sizing: border-box;
    margin-top: 12px;
    padding: 12px 14px;
    border-radius: 10px;
    background: rgba(248, 250, 252, 0.92);
    color: #1f2937;
    font-size: 0.92rem;
    line-height: 1.45;
    word-break: break-word;
    box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.15);
}

.park-popup-notes-display a {
    color: #2563eb;
    text-decoration: underline;
    word-break: break-all;
}

.park-popup-notes-display a:hover {
    color: #1e40af;
}

.park-popup-notes-empty {
    color: #6b7280;
    font-style: italic;
}

.park-popup-notes-label {
    font-weight: 600;
    font-size: 0.95rem;
    text-align: center;
    color: #0f172a;
}

.park-popup-note-actions {
    width: 100%;
    display: flex;
    justify-content: flex-end;
}

.park-popup-edit-link {
    background: none;
    border: none;
    color: #2563eb;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 0;
    text-decoration: underline;
}

.park-popup-edit-link:hover,
.park-popup-edit-link:focus-visible {
    color: #1e40af;
    outline: none;
}

.park-popup-notes-editor {
    width: 100%;
    display: none;
    justify-content: center;
}

.park-popup-card.notes-editing .park-popup-notes-editor {
    display: flex;
}

.park-popup-notes-textarea {
    width: min(100%, 340px);
    min-height: 88px;
    max-height: 260px;
    padding: 12px 14px;
    border: 1px solid #cbd5f5;
    border-radius: 12px;
    resize: vertical;
    font-family: inherit;
    font-size: 0.95rem;
    line-height: 1.45;
    text-align: left;
    box-shadow: 0 6px 18px rgba(37, 99, 235, 0.08);
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    transition: min-height 0.24s ease, box-shadow 0.18s ease;
}

.park-popup-notes-textarea:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
    outline: none;
}

.park-popup-card.notes-editing .park-popup-notes-textarea {
    min-height: 168px;
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.18);
}

.park-popup-note-hint {
    margin-top: 2px;
    font-size: 0.78rem;
    color: #4b5563;
    text-align: center;
}

.park-popup-note-status {
    margin-top: 2px;
    font-size: 0.8rem;
    min-height: 1em;
    color: #2563eb;
    text-align: center;
}

.park-popup-card.has-note .park-popup-note-status {
    color: #047857;
}

.park-popup-note-status.error {
    color: #b91c1c;
}

@media (max-width: 420px) {
    .park-popup-corner-toggle {
        top: -10px;
        left: -10px;
        width: 24px;
        height: 24px;
    }
    .park-popup-corner-toggle .park-popup-corner-icon {
        font-size: 0.75rem;
    }
    .park-popup-notes-textarea {
        min-height: 72px;
    }
    .park-popup-card.notes-editing .park-popup-notes-textarea {
        min-height: 128px;
    }
}

#searchBoxContainer {
    position: relative;
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 10px;
    z-index: 10;
}

#searchBox {
    width: 100%;
    padding: 10px;
    font-size: 16px;
    border: 1px solid #ccc;
    border-radius: 4px;
    outline: none;
    box-sizing: border-box;
    margin-bottom: 10px;
}

#clearSearch {
    display: block !important;
    width: 100%;
    padding: 10px;
    font-size: 16px;
}

#goToParkButton,
#centerOnGeolocation {
    display: block;
    width: 100%;
    padding: 10px;
    font-size: 16px;
    margin-top: 10px;
}

#clearSearch i {
    pointer-events: none;
    color: inherit;
}

/* Hamburger menu styling */
#hamburgerMenu {
    position: fixed;
    top: 10px;
    right: 10px;
    z-index: 1000;
}

#hamburgerMenu #menu .toggle-button.active {
    background: #28a745;
}

#hamburgerMenu #menu #uploadActivations {
    display: block;
    width: 100%;
    padding: 10px;
    font-size: 16px;
    margin-top: 10px;
    color: #fff;
    background: #007BFF;
}

#hamburgerMenu #menu #uploadActivations:hover {
    background: #0056b3;
}

#hamburgerMenu #menu #resetUserDataButton {
    display: block;
    width: 100%;
    padding: 10px;
    font-size: 16px;
    margin-top: 10px;
    color: #7a1f1f;
    background: #fbe2e2;
    border: 1px solid #f5b5b5;
    border-radius: 4px;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

#hamburgerMenu #menu #resetUserDataButton:hover {
    background: #f6caca;
    transform: scale(1.01);
}

#hamburgerMenu #menu #resetUserDataButton:active {
    transform: scale(0.99);
}

#hamburgerMenu #menu #activationsFileInput {
    display: none;
}

/* Mobile hamburger menu tweaks */
#hamburgerMenu.mobile {
    top: 4px;
    right: 4px;
}

#hamburgerMenu.mobile #menu {
    width: 70vw;
    max-width: 260px;
    max-height: calc(100vh - 80px);
    overflow-y: auto;
}

#hamburgerMenu.mobile #menu li {
    margin: 6px 0;
}

#hamburgerMenu.mobile #menu button {
    padding: 8px 10px;
    font-size: 14px;
}

#versionInfo .activation-count {
    display: block;
    margin-top: 0.5em;
    color: #555;
    font-weight: 500;
}



/* ===== Saved Searches Panel (MVP) ===== */
.saved-searches-panel{
    padding:12px 0;
}
.saved-searches-panel .ssp-title{
    font-weight:700;
    margin-bottom:8px;
}
.ssp-row{
    display:flex;
    gap:8px;
    align-items:center;
    flex-wrap:wrap;
    margin-bottom:8px;
}
.ssp-input{
    flex:1 1 200px;
    min-width:180px;
    padding:6px 8px;
    border:1px solid #cbd5e1;
    border-radius:8px;
}
.ssp-check{
    display:flex; gap:6px; align-items:center;
    font-size:0.95em; color:#334155;
}
.ssp-btn{
    padding:10px;
    font-size:16px;
    color:#fff;
    background-color:#336633;
    border:none;
    border-radius:4px;
    cursor:pointer;
    text-align:center;
    transition:background-color 0.3s ease,transform 0.2s ease;
}
.ssp-btn:hover:not(:disabled){
    background-color:#264d26;
    transform:scale(1.02);
}
.ssp-btn:active:not(:disabled){
    transform:scale(0.98);
}
.ssp-btn:disabled{
    background-color:#cccccc;
    color:#666666;
    cursor:not-allowed;
}
.ssp-list{ list-style:none; margin:0; padding:0; }

/* --- Saved Searches: single-row layout with right-aligned icons --- */
/* Make each saved row one line */
/* Ensure this li beats the generic #menu li block rule */
.saved-searches-panel .ssp-item{
    display:flex !important;
    align-items:center;
    flex-wrap:nowrap;      /* never wrap */
    width:100%;
}
.ssp-item:last-child{ border-bottom:none; }
/* Name on the left, bold */
.ssp-name{
    flex:1 1 auto;
    min-width:0;
    font-family:system-ui,-apple-system,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
    font-weight:600;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}
.ssp-name:focus{ outline:2px solid #94a3b8; background:#f8fafc; }
.ssp-name:empty::before {
    content:"(untitled)";
    color:#9aa4b2;        /* muted grey */
    font-weight:500;
}
/* Actions on the far right */
.ssp-actions{
    margin-left:auto;
    display:flex;
    align-items:center;
    gap:4px;
    flex-wrap:nowrap;
    justify-content:flex-end;
}
.ssp-actions > * { flex:0 0 auto; }
/* 🚫 Reset inherited global button styles that make them huge */
.ssp-iconbtn{
    all: unset;             /* nuke width:100%, display:block, padding, etc. */
    display:inline-flex;    /* sit next to each other */
    align-items:center;
    justify-content:center;
    padding:5px;            /* tap target */
    border-radius:6px;
    cursor:pointer;
    color:#1f4d2f;
    user-select:none;
}
.ssp-actions button{ width:auto !important; }  /* belt & suspenders */
.ssp-playbtn{ color:#15803d; }
.ssp-playbtn:hover{ background:rgba(21,128,61,0.1); }
.ssp-iconbtn:hover{ background:rgba(0,0,0,0.06); }
.ssp-iconbtn:focus-visible{ outline:2px solid #1f4d2f; outline-offset:2px; }
.ssp-iconbtn svg{ width:18px; height:18px; display:block; }
.ssp-empty{ color:#64748b; padding:6px 0; }

/* --- PQL/Search overlay safety: never block taps/clicks --- */
#pqlOverlayPane,
#searchHighlightPane {
    pointer-events: none !important;
    z-index: 450 !important; /* below Leaflet's marker pane (600) */
}

#pqlOverlayPane *,
#searchHighlightPane * {
    pointer-events: none !important;
}

/* Any ad-hoc highlight circles/paths should never eat events */
.goto-park-highlight,
.goto-park-highlight * {
    pointer-events: none !important;
}

/* If any PQL decorations render as SVGs without a custom pane, disable their events too */
.pql-overlay,
.pql-overlay * {
    pointer-events: none !important;
}
/* === Popup collapsibles (Recent / Current Activation) === */

.leaflet-popup-content details.popup-collapsible {
    margin: 6px 0 6px;
    padding: 0;
    border: 1px solid rgba(0,0,0,0.15);
    border-radius: 6px;
    background: #fafafa;
    overflow: hidden;
}
.leaflet-popup-content details.popup-collapsible:first-of-type { margin-top: 4px; }
.leaflet-popup-content details.popup-collapsible:last-of-type { margin-bottom: 4px; }

.leaflet-popup-content details.popup-collapsible > summary {
    cursor: pointer;
    list-style: none;
    padding: 8px 10px;
    font-weight: 600;
    outline: none;
    user-select: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.leaflet-popup-content details.popup-collapsible > summary::-webkit-details-marker {
    display: none;
}

.leaflet-popup-content details.popup-collapsible > summary .popup-caret {
    flex: 0 0 auto;
    width: 1em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85em;
    transition: transform 0.2s ease;
    color: #0f172a;
}

.leaflet-popup-content details.popup-collapsible[open] > summary .popup-caret {
    transform: rotate(90deg);
}

.leaflet-popup-content details.popup-collapsible > summary .popup-summary-label {
    flex: 1;
    min-width: 0;
}

.leaflet-popup-content .popup-collapsible-body {
    padding: 8px 10px 10px;
    border-top: 1px solid rgba(0,0,0,0.08);
    background: #fff;
}
.leaflet-popup-content details.popup-collapsible.recent-activations .popup-collapsible-body {
    font-size: 0.9em;
}
@media (max-width: 480px) {
    .leaflet-popup-content details.popup-collapsible { margin: 6px 0 10px; }
    .leaflet-popup-content details.popup-collapsible > summary { padding: 8px 9px; }
    .leaflet-popup-content .popup-collapsible-body { padding: 8px 9px 9px; }
}
