/* Match the catalog's location-field typography on the main map. */
body.map-page #mapFilterPanel .origin-input-wrap input {
  font-family:inherit;
  font-size:15px;
  font-weight:500;
}
body.map-page #mapFilterPanel .origin-input-wrap input::placeholder {
  font-family:inherit;
  font-size:13.5px;
  font-weight:500;
}
@media (max-width:1050px) {
  body.map-page #mapFilterPanel .origin-input-wrap input,
  body.map-page #mapFilterPanel .origin-input-wrap input::placeholder { font-weight:400; }
}

/* Match the catalogue's clear control and selected location action. */
body.map-page #mapFilterPanel .origin-clear-button { color:#647084; }
body.map-page #mapFilterPanel .origin-clear-button:hover { background:#e4eaf0; color:var(--outlo-brand-text-hover,#3730a3); }
body.map-page #mapFilterPanel #useLocation.has-location {
  --outlo-action-current-fill:var(--outlo-secondary-fill,linear-gradient(135deg,#d8bfff 0%,#c5c1ff 55%,#b9d2ff 100%));
  --outlo-action-border:var(--outlo-secondary-border,#b8b4e6);
  --outlo-action-ink:var(--outlo-secondary-ink,#312e81);
  --outlo-action-current-shadow:none;
  background:var(--outlo-secondary-fill,linear-gradient(135deg,#d8bfff 0%,#c5c1ff 55%,#b9d2ff 100%)) no-repeat border-box !important;
  border:1px solid var(--outlo-secondary-border,#b8b4e6) !important;
  color:var(--outlo-secondary-ink,#312e81) !important;
  box-shadow:none !important;
  font-weight:600;
}
body.map-page #mapFilterPanel #useLocation.has-location:hover:not(:disabled):not([aria-disabled="true"]) {
  --outlo-action-current-fill:var(--outlo-secondary-hover,linear-gradient(135deg,#ceb0ff 0%,#b8b5fb 55%,#a9c5fc 100%));
  background:var(--outlo-secondary-hover,linear-gradient(135deg,#ceb0ff 0%,#b8b5fb 55%,#a9c5fc 100%)) no-repeat border-box !important;
  border-color:var(--outlo-secondary-border,#b8b4e6) !important;
}
body.map-page #mapFilterPanel #useLocation.has-location:active:not(:disabled):not([aria-disabled="true"]) {
  --outlo-action-current-fill:var(--outlo-secondary-pressed,linear-gradient(135deg,#c2a2fa 0%,#aaa6ef 55%,#9bb7f0 100%));
  background:var(--outlo-secondary-pressed,linear-gradient(135deg,#c2a2fa 0%,#aaa6ef 55%,#9bb7f0 100%)) no-repeat border-box !important;
}
body.map-page #mapFilterPanel #useLocation.has-location:focus-visible { outline:3px solid #4f46e5 !important; outline-offset:3px !important; }
body.map-page #mapFilterPanel #useLocation.has-location .button-location-icon { color:inherit !important; }

/* The mobile map sheet is anchored to the viewport; desktop panels stay independent. */
@media (max-width:1120px) {
  body.map-page { overflow:hidden !important; overscroll-behavior-y:none; }
  /* Allow the browser's pull-to-refresh from the header, not map/sheet gestures.
     Embedded editors and open dialogs keep the document locked. */
  body.map-page:not(.embedded-event-editor):not(:has(dialog[open])) {
    overflow-x:hidden !important;
    overflow-y:auto !important;
    overscroll-behavior-y:auto;
  }

  body.map-page #mapFilterPanel {
    --sheet-peek-height:72px;
    left:0 !important; right:0 !important; bottom:0 !important;
    width:min(680px,100%) !important; margin-inline:auto;
    padding:0 14px calc(16px + env(safe-area-inset-bottom,0px)) !important;
    border:0 !important; border-radius:16px 16px 0 0 !important;
    scrollbar-gutter:auto;
    scroll-padding-top:calc(var(--sheet-peek-height) + 16px);
    scroll-padding-bottom:calc(16px + env(safe-area-inset-bottom,0px));
    overscroll-behavior:contain;
  }

  /* The closed sheet exposes only its handle and never reserves a scrollbar strip. */
  body.map-page #mapFilterPanel:not(.sheet-overview) {
    overflow:hidden !important; scrollbar-width:none;
  }
  body.map-page #mapFilterPanel:not(.sheet-overview)::-webkit-scrollbar {
    display:none; width:0; height:0;
  }
  /* Extend the native opener over the closed header, including its grip and padding. */
  body.map-page #mapFilterPanel:not(.sheet-overview) .mobile-sheet-handle {
    z-index:auto; transform:none;
  }
  body.map-page #mapFilterPanel:not(.sheet-overview) .mobile-sheet-handle::before {
    content:""; position:absolute; inset:0;
  }
  body.map-page #mapFilterPanel:not(.sheet-overview) .mobile-filters-toggle {
    position:relative; z-index:1;
  }
  body.map-page #mapFilterPanel.sheet-overview {
    overflow-x:hidden; overflow-y:auto;
  }
  body.map-page #mapFilterPanel.sheet-overview::-webkit-scrollbar-track {
    background:var(--map-panel-paper,#f2f4fb);
  }

  /* Keep the close handle readable and reachable while the long tag list scrolls. */
  body.map-page #mapFilterPanel .mobile-sheet-header {
    position:sticky !important; top:0 !important;
    box-sizing:border-box;
    min-height:72px !important;
    padding:17px 20px 10px !important;
    column-gap:20px;
    border-radius:16px 16px 0 0 !important;
    background-color:var(--map-panel-paper,#f2f4fb);
    background-image:radial-gradient(ellipse at 100% 0%,var(--map-panel-upper-glow,transparent),transparent 70%);
    background-size:100% 440px;
    box-shadow:0 4px 12px -8px rgb(15 23 42 / 16%) !important;
  }
  body.map-page #mapFilterPanel .mobile-sheet-copy { gap:4px; }
  body.map-page #mapFilterPanel.sheet-overview > .proximity-section { padding-top:18px; }
}

@media (max-width:360px) {
  body.map-page #mapFilterPanel .mobile-sheet-header { padding-inline:16px !important; column-gap:16px; }
}

@media (orientation:landscape) and (max-height:600px) and (max-width:950px) {
  body.map-page #mapFilterPanel { --sheet-peek-height:56px; }
  body.map-page #mapFilterPanel .mobile-sheet-header { min-height:56px !important; padding:9px 16px 2px !important; column-gap:16px; }
  body.map-page #mapFilterPanel .mobile-sheet-copy { gap:2px; }
  body.map-page #mapFilterPanel.sheet-overview > .proximity-section { padding-top:12px; }
}

@media (max-width:1120px) and (forced-colors:active) {
  body.map-page #mapFilterPanel .mobile-sheet-header { background:Canvas; box-shadow:none !important; }
}
