select[data-scope],
.scope .scope-btn {
  box-sizing: border-box;
  margin: 0;
  padding: 0 38px 0 16px;
  border: 1px solid var(--ll-line-strong, #cfd5dd);
  background-color: var(--ll-accent-soft, rgba(28, 51, 95, 0.08));
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%235d6b7a' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 15px center;
  color: var(--ll-ink-2, #2e3f52);
  font-family: inherit;
  font-size: 0.97rem;
  font-weight: 600;
  line-height: 1.2;
  text-align: left;
  cursor: pointer;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  transition: background-color 0.14s ease;
}

select[data-scope]:hover,
.scope .scope-btn:hover,
.scope.is-open .scope-btn {
  background-color: var(--ll-accent-wash, rgba(28, 51, 95, 0.14));
}

select[data-scope]:focus-visible,
.scope .scope-btn:focus-visible {
  outline: 2px solid var(--ll-accent, #24467f);
  outline-offset: -3px;
}

.scope {
  position: relative;
  display: flex;
  flex: 0 0 auto;
}

.scope > select {
  display: none;
}

.scope .scope-btn {
  display: flex;
  align-items: center;
  width: 100%;
  background-image: none;
}

.scope-label {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scope-caret {
  position: absolute;
  top: 50%;
  right: 15px;
  width: 12px;
  height: 8px;
  margin-top: -4px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%235d6b7a' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat center;
  transition: transform 0.16s ease;
  pointer-events: none;
}

.scope.is-open .scope-caret {
  transform: rotate(180deg);
}

.scope-list {
  position: absolute;
  z-index: 1200;
  top: calc(100% + 8px);
  left: 0;
  box-sizing: border-box;
  width: max-content;
  min-width: 100%;
  margin: 0;
  padding: 6px;
  list-style: none;
  border: 1px solid var(--ll-line-strong, #cfd5dd);
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 2px 6px rgba(15, 27, 42, 0.08), 0 22px 44px -18px rgba(15, 27, 42, 0.5);
  animation: scope-in 0.14s ease both;
}

.scope-list[hidden] {
  display: none;
}

.scope-opt {
  position: relative;
  padding: 10px 14px;
  border-radius: 8px;
  color: var(--ll-ink-2, #2e3f52);
  font-size: 0.96rem;
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
}

.scope-opt.is-active {
  background: var(--ll-accent-soft, rgba(28, 51, 95, 0.08));
}

.scope-opt[aria-selected="true"] {
  color: var(--ll-accent, #1c335f);
  font-weight: 700;
}

.scope-opt-last {
  margin-top: 9px;
}

.scope-opt-last::before {
  content: "";
  position: absolute;
  top: -5px;
  right: 8px;
  left: 8px;
  height: 1px;
  background: var(--ll-line, #e4e7ec);
}

@keyframes scope-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .scope-list { animation: none; }
  .scope-caret { transition: none; }
}

.qs-pill {
  display: flex;
  align-items: stretch;
  box-sizing: border-box;
  width: 100%;
  border: 1px solid #cccccc;
  border-radius: 8px;
  background: #ffffff;
}

#quick-search-wrap .qs-pill #quick-search-input {
  flex: 1 1 0;
  width: auto;
  min-width: 0;
  border: 0;
  border-radius: 0 7px 7px 0;
  background: transparent;
  outline: none;
}

.qs-pill > select[data-scope="nav"],
.scope-nav {
  flex: 0 0 132px;
  width: 132px;
}

.qs-pill > select[data-scope="nav"],
.scope-nav .scope-btn {
  box-sizing: border-box;
  width: 132px;
  border: 0;
  border-right: 1px solid #d9dde3;
  border-radius: 7px 0 0 7px;
  background-color: #f1f3f6;
  font-size: 14.5px;
}

.qs-pill > select[data-scope="nav"]:hover,
.scope-nav .scope-btn:hover,
.scope-nav.is-open .scope-btn {
  background-color: #e6eaf0;
}

.scope-nav .scope-list {
  left: 0;
  min-width: 200px;
}

select[data-scope="page"],
.scope-page .scope-btn {
  width: 160px;
  height: 100%;
  border: 0;
  border-right: 1px solid var(--ll-line-strong, #cfd5dd);
  border-radius: 13px 0 0 13px;
  padding-left: 22px;
  font-size: 1.02rem;
}

.scope-page {
  align-self: stretch;
}

.scope-page .scope-list {
  min-width: 230px;
}

.home-pill {
  display: flex;
  flex: 1 1 280px;
  align-items: stretch;
  min-width: 0;
  border: 1px solid var(--ll-line-strong, #cfd5dd);
  border-radius: 9px;
  background: var(--ll-surface, #ffffff);
}

.home-pill:focus-within {
  outline: 2px solid var(--ll-accent, #24467f);
  outline-offset: 2px;
}

.home-search-row .home-pill input {
  flex: 1 1 0;
  min-width: 0;
  border: 0;
  border-radius: 0 8px 8px 0;
  background: transparent;
}

.home-search-row .home-pill input:focus-visible {
  outline: none;
}

.home-pill > select[data-scope="home"],
.scope-home .scope-btn {
  min-width: 142px;
  border: 0;
  border-right: 1px solid var(--ll-line-strong, #cfd5dd);
  border-radius: 8px 0 0 8px;
  padding-top: 15px;
  padding-bottom: 15px;
  font-size: 1.02rem;
}

.scope-home {
  flex: 0 0 auto;
}

.scope-home .scope-list {
  min-width: 220px;
}

@media (max-width: 600px) {
  .qs-pill {
    flex-wrap: wrap;
  }

  .qs-pill > select[data-scope="nav"],
  .scope-nav {
    flex: 1 1 100%;
    width: 100%;
  }

  .qs-pill > select[data-scope="nav"],
  .scope-nav .scope-btn {
    width: 100%;
    height: 48px;
    border-right: 0;
    border-bottom: 1px solid #d9dde3;
    border-radius: 7px 7px 0 0;
    font-size: 16px;
  }

  #quick-search-wrap .qs-pill #quick-search-input {
    flex: 1 1 100%;
    border-radius: 0 0 7px 7px;
  }

  #quick-search-wrap #quick-search-results {
    top: 104px;
  }

  #quick-search-wrap #quick-search-clear {
    top: 74px;
  }

  .scope-nav .scope-list {
    min-width: 100%;
  }
}

@media (max-width: 640px) {
  .cs-box {
    flex-wrap: wrap;
  }

  select[data-scope="page"],
  .scope-page {
    flex: 1 1 100%;
  }

  select[data-scope="page"],
  .scope-page .scope-btn {
    width: 100%;
    height: 48px;
    border-right: 0;
    border-bottom: 1px solid var(--ll-line-strong, #cfd5dd);
    border-radius: 13px 13px 0 0;
  }
}

@media (max-width: 720px) {
  .home-pill {
    flex: 1 1 100%;
  }
}
