/* Application overrides live outside the refreshable upstream stylesheet. */
.ts-hidden-accessible {
  height: 1px !important;
  left: 0 !important;
  max-width: 1px !important;
  min-width: 1px !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

select.tomselected {
  max-width: 1px !important;
  min-width: 1px !important;
  width: 1px !important;
}

/* RSP dropdown presentation */
.ts-dropdown {
  z-index: 80;
  margin-top: 0.25rem;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  background: #fff;
  color: #334155;
  box-shadow:
    0 18px 45px rgba(15, 23, 42, 0.14),
    0 6px 18px rgba(15, 23, 42, 0.08),
    0 0 0 1px rgba(15, 23, 42, 0.04);
}

.ts-dropdown.international-phone-dropdown {
  min-width: 0;
  max-width: calc(100vw - 24px);
}

/* Searchable menus use the shared form control's border, type and focus state.
   Include the plugin class so upstream's bottom-only border cannot win. */
.ts-dropdown.plugin-dropdown_input .dropdown-input-wrap {
  padding: 0.5rem;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
}

.ts-dropdown.plugin-dropdown_input .dropdown-input {
  box-sizing: border-box;
  display: block;
  width: 100%;
  min-width: 0;
  height: 40px;
  min-height: 40px;
  margin: 0;
  padding: 0 0.75rem;
  appearance: none;
  border: 1px solid #e2e8f0;
  border-radius: 0.375rem;
  background: #fff;
  color: #334155;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 400;
  line-height: 1.25rem;
  outline: none;
  box-shadow: none;
  transition: border-color 150ms, box-shadow 150ms;
}

.ts-dropdown.plugin-dropdown_input .dropdown-input::placeholder {
  color: #94a3b8;
  opacity: 1;
}

.ts-dropdown.plugin-dropdown_input .dropdown-input:focus {
  border-color: #818cf8;
  outline: none;
  box-shadow: 0 0 0 3px rgb(99 102 241 / 0.1);
}

.ts-dropdown-content {
  max-height: min(17.5rem, 52vh);
  overflow-y: auto;
  padding: 0.25rem;
  scroll-behavior: smooth;
}

.ts-dropdown .option,
.ts-dropdown .optgroup-header,
.ts-dropdown .no-results,
.ts-dropdown .create {
  min-height: 2rem;
  padding: 0.4375rem 0.625rem;
  border-radius: 0.375rem;
  font-size: 0.75rem;
  line-height: 1rem;
}

.ts-dropdown .option {
  /* Keep highlighted spans in the same text flow as the surrounding label. */
  display: block;
  color: #334155;
}

.ts-dropdown [data-selectable].option {
  transition-property: background-color, color;
  transition-duration: 150ms;
  transition-timing-function: cubic-bezier(0.2, 0, 0, 1);
}

.ts-dropdown .active {
  background: #eef2ff;
  color: #3730a3;
}

.ts-dropdown .selected {
  background: #f8fafc;
  color: #0f172a;
  font-weight: 600;
}

.ts-dropdown .active.selected {
  background: #e0e7ff;
  color: #312e81;
}

.ts-dropdown [data-disabled],
.ts-dropdown [data-disabled] [data-selectable].option {
  color: #94a3b8;
  opacity: 1;
}

.ts-dropdown .no-results,
.ts-dropdown .create {
  color: #64748b;
}

.ts-dropdown [data-selectable] .highlight {
  border-radius: 0.25rem;
  background: #fef3c7;
  color: #92400e;
}

.ts-dropdown .optgroup-header {
  min-height: auto;
  padding: 0.375rem 0.625rem 0.25rem;
  background: transparent;
  color: #64748b;
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.ts-dropdown .rsp-select-option-title {
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.ts-dropdown .rsp-select-option-detail {
  margin-top: 2px;
  color: #64748b;
  font-size: 11.5px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.ts-dropdown .active .rsp-select-option-detail {
  color: inherit;
}

.ts-dropdown.plugin-dropdown_input .option {
  font-size: 12.5px;
  white-space: normal;
  overflow-wrap: anywhere;
}

@media (max-width: 1023px), (any-pointer: coarse) {
  .ts-dropdown.plugin-dropdown_input .dropdown-input {
    height: 44px;
    min-height: 44px;
    font-size: 16px;
  }

  .ts-dropdown.plugin-dropdown_input .option {
    min-height: 44px;
    padding: 0.75rem 0.625rem;
    line-height: 1.25rem;
  }
}
