/* Keep the chevron inside a fixed box, independent of the label line height. */
.layout-container .filter-header .arrow-down {
  display: block;
  position: relative;
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  overflow: visible;
  transition: transform 180ms ease;
}
.layout-container .filter-header .arrow-down::before {
  content: "";
  position: absolute;
  top: 6px;
  left: 7px;
  width: 9px;
  height: 9px;
  border-right: 2px solid currentcolor;
  border-bottom: 2px solid currentcolor;
  background: none;
  transform: rotate(45deg);
}
.layout-container .filter-header .arrow-down::after { content: none; }
.layout-container .filter[is-open="true"] .arrow-down,
.layout-container .filter-header[aria-expanded="true"] .arrow-down {
  transform: rotate(180deg);
}

@keyframes sec-menu-enter {
  from { opacity: 0; translate: 0 -5px; }
  to { opacity: 1; translate: 0 0; }
}
@media (prefers-reduced-motion: no-preference) {
  .layout-container .filter-options,
  .pilots-map-page .popup { animation: sec-menu-enter 180ms ease-out; }
}

/* A quiet underline keeps dropdown feedback consistent with the open layout. */
.layout-container .filter-header {
  position: relative;
}
.layout-container .filter-header::after {
  content: "";
  position: absolute;
  inset: auto 0 -2px;
  height: 2px;
  background: var(--sec-color-focus);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 220ms ease;
  pointer-events: none;
}
@media (hover: hover) {
  .layout-container .filter-header:hover::after {
    transform: scaleX(1);
  }
}
.layout-container .filter-header[aria-expanded="true"]::after {
  transform: scaleX(1);
}

.layout-container .sec-native-select {
  /* Enhancement supplies the visible control; prevent duplicate AT controls
     and absolutely positioned native selects from expanding the document. */
  display: none !important;
}
.layout-container .sec-form-dropdown { position: relative; width: 100%; }
.layout-container .sec-form-dropdown[is-open="true"] { z-index: 30; }
.layout-container .sec-form-dropdown .filter-header {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 20px;
  border: 0;
  border-bottom: 2px solid var(--sec-color-text);
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.layout-container .sec-form-dropdown .filter-options {
  position: absolute;
  inset: calc(100% + 8px) 0 auto;
  width: 100%;
  max-height: 40vh;
  overflow: auto;
  border-radius: 20px;
  background: rgb(255 255 255 / 65%);
  backdrop-filter: blur(40px);
  z-index: 3;
}
.layout-container .sec-form-dropdown .filter-options[hidden] { display: none; }
.layout-container .sec-form-dropdown .filter-option {
  display: block;
  width: 100%;
  padding: 12px 20px;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.layout-container .sec-form-dropdown .filter-option:hover,
.layout-container .sec-form-dropdown .filter-option[is-active="true"] {
  background: rgb(255 255 255 / 60%);
}
.layout-container form .sec-form-dropdown {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}
.layout-container form .sec-form-dropdown .filter-title {
  min-width: 0;
  overflow-wrap: anywhere;
}

@media (max-width: 767px) {
  .layout-container main :is(.filter, .sec-form-dropdown) {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }
  .layout-container main :is(.filter, .sec-form-dropdown) .filter-header {
    font-size: 18px;
    line-height: 1.35;
    padding: 10px;
    min-height: 44px;
  }
  .layout-container main :is(.filter, .sec-form-dropdown) .filter-title {
    font-size: 18px;
    line-height: 1.35;
  }
  .layout-container main :is(.filter, .sec-form-dropdown) .filter-option {
    font-size: 16px;
    line-height: 1.4;
    padding: 12px 16px;
    min-height: 44px;
  }
}


/* State-owned visibility avoids static inline styles on map dropdowns. */
.layout-container .filter[is-open="true"] > .filter-options { display: block; }
.layout-container .filter[is-open="false"] > .filter-options { display: none; }
