/* Atlas-style command bar shared by the Pal Explorer controls. */
.catalog-command--atlas,
.catalog-controls--atlas {
  --catalog-chevron-size: .68rem;
  --catalog-chevron-color: var(--cyan, #69d9e6);
  --catalog-chevron-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpolyline points='6 9 12 15 18 9' fill='none' stroke='white' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.catalog-controls--atlas {
  display: grid;
  grid-template-columns: minmax(16rem, 1fr) minmax(12.5rem, 15rem);
  align-items: end;
  gap: .5rem;
}

.catalog-controls--atlas .catalog-search-form { min-width: 0; }
.catalog-controls--atlas .catalog-control-label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.catalog-command--atlas { padding-block: clamp(1.25rem, 2.5vw, 2rem) .75rem; }

.catalog-controls--atlas .atlas-search-control,
.catalog-controls--atlas .atlas-sort-control select,
.catalog-controls--atlas .atlas-filter-trigger {
  min-height: 2.65rem;
  border: 1px solid #52676f;
  border-radius: 0;
  background: rgb(3 11 15 / 88%);
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 0 100%);
}

.catalog-controls--atlas .atlas-search-control {
  display: grid;
  grid-template-columns: 1.1rem minmax(0, 1fr) auto;
  align-items: center;
  gap: .55rem;
  padding: 0 .55rem;
  border-width: 0 0 2px;
  border-color: var(--cyan);
  background: transparent;
  clip-path: none;
}

.catalog-controls--atlas .atlas-search-control > svg { position: static; z-index: auto; left: auto; width: 1.05rem; height: 1.05rem; fill: none; stroke: #8db4bd; stroke-width: 1.8; }

.catalog-controls--atlas .atlas-search-control input {
  height: 2.5rem;
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.catalog-controls--atlas .atlas-search-control:focus-within,
.catalog-controls--atlas .atlas-sort-control:focus-within {
  border-color: var(--cyan);
  box-shadow: none;
}

.catalog-controls--atlas .atlas-search-control input::placeholder { color: #effcff; opacity: 1; }
.catalog-controls--atlas .atlas-search-control input:focus { border: 0; box-shadow: none; outline: 0; }

.catalog-controls--atlas .atlas-search-control button {
  position: absolute;
  right: .4rem;
  padding: .25rem .3rem;
  font-size: .62rem;
}

.atlas-control-count { color: var(--cyan); font-size: .68rem; font-weight: 850; font-variant-numeric: tabular-nums; }
.atlas-control-chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--catalog-chevron-size);
  height: var(--catalog-chevron-size);
  color: var(--cyan);
}
.atlas-control-chevron::before {
  content: "";
  width: 100%;
  height: 100%;
  background: var(--catalog-chevron-color);
  mask: var(--catalog-chevron-mask) center / contain no-repeat;
  -webkit-mask: var(--catalog-chevron-mask) center / contain no-repeat;
  transform: rotate(0deg);
}

.catalog-controls--atlas .atlas-sort-control {
  position: relative;
  z-index: 90;
  min-height: 2.65rem;
  padding: 0;
  display: block;
}
.catalog-controls--atlas .atlas-reset {
  position: absolute;
  top: calc(100% + .8rem);
  right: 0;
  min-height: 2.25rem;
  padding: 0 .7rem;
  border-radius: 0;
  font-size: .66rem;
  font-weight: 750;
}
.catalog-controls--atlas .atlas-sort-control > select { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

.catalog-controls--atlas .atlas-sort-menu { position: relative; }
.catalog-controls--atlas .atlas-sort-menu > summary {
  min-height: 2.65rem;
  padding: .35rem .7rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .8rem;
  color: var(--text);
  border: 1px solid rgb(54 89 102 / 48%);
  border-bottom: 2px solid var(--cyan);
  border-radius: 5px;
  background: linear-gradient(180deg, rgb(12 29 39 / 96%), rgb(8 22 30 / 96%));
  box-shadow: inset 0 1px rgb(177 232 239 / 4%);
  clip-path: none;
  cursor: pointer;
  list-style: none;
  transition: border-color 170ms ease, background 170ms ease, box-shadow 170ms ease, transform 150ms ease;
}
.catalog-controls--atlas .atlas-sort-menu > summary::-webkit-details-marker { display: none; }
.catalog-controls--atlas .atlas-sort-menu > summary:hover {
  border-color: rgb(105 217 230 / 72%);
  background: linear-gradient(180deg, rgb(17 48 59 / 98%), rgb(10 32 41 / 98%));
  box-shadow: inset 0 0 0 1px rgb(161 246 255 / 6%), 0 4px 14px rgb(0 0 0 / 18%);
  transform: translateY(-1px);
}
.catalog-controls--atlas .atlas-sort-menu > summary:active { transform: translateY(1px) scale(.985); }
.catalog-controls--atlas .atlas-sort-menu > summary:focus-visible {
  border-color: #69d9e6;
  outline: 2px solid rgb(105 217 230 / 25%);
  outline-offset: 2px;
}
.catalog-controls--atlas .atlas-sort-menu[open] > summary {
  border-color: var(--cyan);
  background: linear-gradient(180deg, rgb(14 47 57 / 98%), rgb(9 32 41 / 98%));
  box-shadow: inset 0 0 0 1px rgb(115 224 235 / 7%), 0 5px 18px rgb(0 0 0 / 22%);
}
.catalog-controls--atlas .atlas-sort-copy { min-width: 0; display: grid; gap: 1px; }
.catalog-controls--atlas .atlas-sort-copy small {
  color: #76969d;
  font-size: .46rem;
  font-weight: 820;
  letter-spacing: .11em;
  line-height: 1;
  text-transform: uppercase;
}
.catalog-controls--atlas #sortMenuLabel {
  overflow: hidden;
  color: #e7f8fa;
  font-size: .72rem;
  font-weight: 740;
  line-height: 1.12;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.catalog-controls--atlas .atlas-control-chevron { transition: color 180ms ease; }
.catalog-controls--atlas .atlas-control-chevron::before { transition: transform 180ms ease; }
.catalog-controls--atlas .atlas-sort-menu[open] .atlas-control-chevron { color: #8cf1f7; }
.catalog-controls--atlas .atlas-sort-menu[open] .atlas-control-chevron::before { transform: rotate(180deg); }
.catalog-controls--atlas .atlas-sort-menu > div {
  position: absolute;
  z-index: 120;
  top: calc(100% + .45rem);
  right: 0;
  left: 0;
  padding: .4rem;
  display: grid;
  gap: .25rem;
  overflow: hidden;
  border: 1px solid rgb(105 217 230 / 42%);
  border-radius: 6px;
  background: linear-gradient(180deg, rgb(8 27 36 / 99%), rgb(3 13 19 / 99%));
  box-shadow: 0 20px 46px rgb(0 0 0 / 62%), inset 0 1px rgb(177 232 239 / 5%);
  transform-origin: top right;
  animation: atlas-sort-menu-in 180ms cubic-bezier(.2, .75, .25, 1);
}
.catalog-controls--atlas .atlas-sort-menu button {
  position: relative;
  min-height: 2.25rem;
  padding: 0 2rem 0 .65rem;
  color: #b9cdd1;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  text-align: left;
  font-size: .7rem;
  font-weight: 650;
  cursor: pointer;
  transition: color 150ms ease, border-color 150ms ease, background 150ms ease, padding-left 150ms ease, transform 150ms ease;
}
.catalog-controls--atlas .atlas-sort-menu button:hover,
.catalog-controls--atlas .atlas-sort-menu button:focus-visible {
  padding-left: .82rem;
  color: #f0fdff;
  border-color: rgb(105 217 230 / 34%);
  background: rgb(34 89 99 / 31%);
  outline: 0;
  transform: translateX(2px);
}
.catalog-controls--atlas .atlas-sort-menu button:active { transform: translateX(2px) scale(.985); }
.catalog-controls--atlas .atlas-sort-menu button[aria-selected="true"] {
  color: #bfffff;
  border-color: rgb(105 217 230 / 45%);
  background: linear-gradient(90deg, rgb(18 91 104 / 52%), rgb(12 52 63 / 58%));
}
.catalog-controls--atlas .atlas-sort-menu button[aria-selected="true"]::after {
  position: absolute;
  right: .68rem;
  width: .42rem;
  height: .72rem;
  border-right: 2px solid #83f3ed;
  border-bottom: 2px solid #83f3ed;
  content: "";
  transform: translateY(-.08rem) rotate(45deg);
}

@keyframes atlas-sort-menu-in {
  from { opacity: 0; transform: translateY(-6px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.catalog-controls--atlas .atlas-sort-control select {
  width: 100%;
  height: 2.65rem;
  padding: 0 2.3rem 0 .85rem;
  appearance: none;
  color: var(--text);
  font-size: .76rem;
  font-weight: 700;
  text-transform: none;
  letter-spacing: .01em;
  outline: 0;
}

.catalog-controls--atlas .atlas-filter-trigger {
  min-height: 2.65rem;
  padding: 0 .95rem;
  gap: .45rem;
  color: #c7d9dc;
  border-color: #52676f;
  background: rgb(3 11 15 / 88%);
}

.catalog-controls--atlas .atlas-filter-trigger:hover,
.catalog-controls--atlas .atlas-filter-trigger[aria-expanded="true"] {
  color: #d9fcff;
  border-color: #69d9e6;
  background: rgb(15 55 65 / 78%);
  box-shadow: inset 0 0 0 1px rgb(161 246 255 / 8%);
}

.catalog-controls--atlas .atlas-filter-trigger:focus-visible { box-shadow: 0 0 0 2px rgb(19 229 237 / 22%); }
.catalog-controls--atlas .filter-count-badge { margin-left: .05rem; }

/* Native-select variant for catalogs that keep their URL/state runtime on real
   form controls. It shares the Pal Explorer field surface without replacing
   the accessible select with page-specific menu code. */
.catalog-controls--atlas select.catalog-native-control,
.catalog-command--atlas .inline-filters select.catalog-native-control {
  width: 100%;
  min-width: 0;
  min-height: 2.65rem;
  height: 2.65rem;
  padding: 0 2rem 0 .72rem;
  appearance: none;
  color: #e7f8fa;
  border: 1px solid rgb(54 89 102 / 48%);
  border-bottom: 2px solid var(--cyan, #13e5ed);
  border-radius: 5px;
  background:
    linear-gradient(45deg, transparent 50%, #69d9e6 50%) calc(100% - .82rem) 50% / .35rem .35rem no-repeat,
    linear-gradient(135deg, #69d9e6 50%, transparent 50%) calc(100% - .58rem) 50% / .35rem .35rem no-repeat,
    linear-gradient(180deg, rgb(12 29 39 / 96%), rgb(8 22 30 / 96%));
  box-shadow: inset 0 1px rgb(177 232 239 / 4%);
  font-size: .72rem;
  font-weight: 700;
  outline: 0;
}

.catalog-select-shell {
  position: relative;
  display: block;
  min-width: 0;
}

.catalog-select-shell > select { appearance: none; }
.catalog-select-shell > .atlas-control-chevron {
  position: absolute;
  top: 50%;
  right: .7rem;
  color: var(--cyan);
  pointer-events: none;
  transform: translateY(-50%);
}

.catalog-controls--atlas .atlas-sort-control > select.catalog-native-control {
  position: static;
  width: 100%;
  height: 2.65rem;
  opacity: 1;
  pointer-events: auto;
}

.catalog-controls--atlas select.catalog-native-control:hover,
.catalog-command--atlas .inline-filters select.catalog-native-control:hover {
  border-color: rgb(105 217 230 / 72%);
  background-color: rgb(17 48 59 / 98%);
}

.catalog-controls--atlas select.catalog-native-control:focus-visible,
.catalog-command--atlas .inline-filters select.catalog-native-control:focus-visible {
  border-color: #69d9e6;
  outline: 2px solid rgb(105 217 230 / 25%);
  outline-offset: 2px;
}

