.custom-picker {
  position: relative;
  width: 100%;
  font-family: inherit;
  direction: rtl;
}

.custom-picker-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 12px 16px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 800;
  color: #1e293b;
  cursor: pointer;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  text-align: right;
  line-height: 1.5;
  min-height: 48px;
}

.custom-picker-trigger:hover {
  border-color: #cbd5e1;
}

.custom-picker-trigger:focus-visible {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.custom-picker-trigger.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: #f8fafc;
}

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

.custom-picker-arrow {
  flex-shrink: 0;
  color: #94a3b8;
  transition: transform 0.2s ease;
}

.custom-picker-dropdown.open + .custom-picker-trigger .custom-picker-arrow,
.custom-picker-trigger[aria-expanded="true"] .custom-picker-arrow {
  transform: rotate(180deg);
}

.custom-picker-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 1000;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.12);
  max-height: 320px;
  display: none;
  flex-direction: column;
  overflow: hidden;
  color: #334155;
}

.custom-picker-dropdown.open {
  display: flex;
}

.custom-picker-search {
  padding: 10px 12px 6px;
  flex-shrink: 0;
}

.custom-picker-search.hidden {
  display: none;
}

.custom-picker-search input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  outline: none;
  background: #f8fafc;
  color: #1e293b;
  transition: border-color 0.15s ease;
  box-sizing: border-box;
}

.custom-picker-search input:focus {
  border-color: #6366f1;
  background: #fff;
}

.custom-picker-options {
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 6px;
  flex: 1;
  max-height: 260px;
}

.custom-picker-option {
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  color: #334155;
  cursor: pointer;
  transition: background 0.1s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.custom-picker-option:hover {
  background: #f1f5f9;
}

.custom-picker-option:focus-visible {
  outline: 3px solid #0f766e;
  outline-offset: 1px;
  background: #ecfdf5;
}

.custom-picker-option.selected {
  background: #eef2ff;
  color: #4f46e5;
  font-weight: 800;
}

.custom-picker-option.disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

.custom-picker-option.hidden {
  display: none;
}

.custom-picker-option.hint {
  color: #64748b;
  font-weight: 700;
  font-size: 12px;
  text-align: center;
  cursor: default;
  pointer-events: none;
}

.custom-picker-option.hint.error {
  color: #ef4444;
}

.custom-picker-status {
  padding: 4px 14px 0;
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  text-align: center;
}

.custom-picker-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 6px 0;
}

.custom-picker-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: #eef2ff;
  color: #4f46e5;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.5;
}

.custom-picker-chip-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border: none;
  background: rgba(79, 70, 229, 0.12);
  border-radius: 50%;
  color: #4f46e5;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  transition: background 0.1s ease;
}

.custom-picker-chip-remove:hover {
  background: rgba(79, 70, 229, 0.2);
}

.custom-picker-options::-webkit-scrollbar {
  width: 5px;
}

.custom-picker-options::-webkit-scrollbar-track {
  background: transparent;
}

.custom-picker-options::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 999px;
}
